install vite as build system, preact and panda for the ui, and create Button component

This commit is contained in:
Guillaume Dorce 2023-08-30 17:44:40 +02:00
parent 708a991f45
commit 74a95cfb85
93 changed files with 39941 additions and 143 deletions

26
.gitignore vendored
View File

@ -1,2 +1,24 @@
dist/ # Logs
node_modules/ logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -3,7 +3,7 @@
The goal of this repository is to improve code quality and ease of maintenance in the future. The goal of this repository is to improve code quality and ease of maintenance in the future.
To achieve this goal, I plan to rewrite the code with TypeScript, and use a lightweight ui library like tailwindcss. To achieve this goal, I plan to rewrite the code with TypeScript, and use a lightweight ui library like tailwindcss.
All this library cannot be possible without the hard work of Amauri, the creator of [tarteaucitron.js](/AmauriC/tarteaucitron.js). All this library cannot be possible without the hard work of Amauri, the creator of [tarteaucitron.js](https://github.com/AmauriC/tarteaucitron.js).
So make sure to support his work. So make sure to support his work.
# tarteaucitron.js # tarteaucitron.js

12
index.html Normal file
View File

@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Preact + TS + TarteAuxMyrtilles</title>
</head>
<body>
<div id="tarteauxmyrtilles"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@ -1,30 +1,24 @@
{ {
"name": "tarteauxmyrtilles", "name": "test-cookie",
"private": true,
"version": "0.0.0", "version": "0.0.0",
"main": "index.ts", "type": "module",
"description": "Comply to the European cookie law", "main": "./dist/tarteauxmyrtilles.umd.js",
"devDependencies": { "module": "./dist/tarteauxmyrtilles.esm.js",
"typescript": "^5.2.2"
},
"scripts": { "scripts": {
"dev": "tsc -w", "dev": "vite",
"build": "tsc" "build": "tsc && vite build",
"preview": "vite preview",
"prepare": "panda codegen"
}, },
"repository": { "dependencies": {
"type": "git", "preact": "^10.16.0"
"url": "git+https://github.com/polynux/tarteauxmyrtilles.git"
}, },
"keywords": [ "devDependencies": {
"cookie", "@pandacss/dev": "^0.13.0",
"law", "@preact/preset-vite": "^2.5.0",
"rgpd", "@types/node": "^20.5.7",
"gdpr", "typescript": "^5.0.2",
"cookie" "vite": "^4.4.5"
], }
"author": "Guillaume Dorce",
"license": "MIT",
"bugs": {
"url": "git+https://github.com/polynux/tarteauxmyrtilles.git"
},
"homepage": "https://github.com/polynux/tarteauxmyrtilles#readme"
} }

22
panda.config.ts Normal file
View File

@ -0,0 +1,22 @@
import { defineConfig } from "@pandacss/dev"
export default defineConfig({
// Whether to use css reset
preflight: true,
// Where to look for your css declarations
include: ["./src/**/*.{js,jsx,ts,tsx}"],
// Files to exclude
exclude: [],
// Useful for theme customization
theme: {
extend: {}
},
// The output directory for your css system
outdir: "./src/styled-system",
})

File diff suppressed because it is too large Load Diff

5
postcss.config.cjs Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
plugins: {
'@pandacss/dev/postcss': {},
},
}

37
src/app.tsx Normal file
View File

@ -0,0 +1,37 @@
import { css } from "@/styled-system/css";
import Button from "./components/Button";
export function App() {
return (
<div
className={css({
position: "fixed",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
backgroundColor: "blue.100",
rounded: "lg",
p: 4,
})}
>
<h3
className={css({
backgroundColor: "blue.800",
color: "white",
})}
>
TarteAuxMyrtilles
</h3>
<p
className={css({
color: "blue.800",
})}
>
Hello World
</p>
<Button
onClick={() => {console.log("Hello World")}}
>Click me</Button>
</div>
);
}

44
src/components/Button.tsx Normal file
View File

@ -0,0 +1,44 @@
import { css } from "@/styled-system/css";
import { ComponentChild, ComponentProps } from "preact";
type ButtonProps = ComponentProps<"button"> & {
children: ComponentChild;
onClick?: (event: MouseEvent) => void;
type?: "button" | "submit" | "reset";
}
export default function Button({ children, type, onClick, ...props }: ButtonProps) {
return (
<button
className={css({
backgroundColor: "blue.100",
color: "blue.800",
border: "1px solid",
borderColor: "blue.800",
cursor: "pointer",
transition: "all 0.2s",
boxShadow: "0 0 0 1px rgba(0, 0, 0, 0.05)",
p: 4,
rounded: "lg",
_hover: {
backgroundColor: "blue.200",
borderColor: "blue.200",
boxShadow: "0 0 0 1px rgba(0, 0, 0, 0.1)",
},
_active: {
backgroundColor: "blue.300",
},
_focus: {
boxShadow: "0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(0, 0, 255, 0.2)",
outline: "none",
inset: "0 0 0 3px rgba(0, 0, 255, 0.2)",
}
})}
type={type ?? "button"}
onClick={onClick}
{...props}
>
{children}
</button>
);
}

1
src/index.css Normal file
View File

@ -0,0 +1 @@
@layer reset, base, tokens, recipes, utilities;

View File

@ -1,9 +0,0 @@
console.log('Hello, world!')
function test(str: string): void {
for (let i = 0; i < 10; i++) {
console.log(i, str)
}
}
test('Hello, world!')

10
src/main.tsx Normal file
View File

@ -0,0 +1,10 @@
import { render } from 'preact'
import { App } from './app.tsx'
import './index.css'
if (!document.getElementById('tarteauxmyrtilles')) {
const div = document.createElement('div')
div.id = 'tarteauxmyrtilles'
document.body.appendChild(div)
}
render(<App />, document.getElementById('tarteauxmyrtilles')!)

6249
src/services.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
import { withoutSpace } from '../helpers.mjs';
const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base"
const conditions = new Set(conditionsStr.split(','))
export function isCondition(value){
return conditions.has(value) || /^@|&|&$/.test(value)
}
const underscoreRegex = /^_/
const conditionsSelectorRegex = /&|@/
export function finalizeConditions(paths){
return paths.map((path) => {
if (conditions.has(path)){
return path.replace(underscoreRegex, '')
}
if (conditionsSelectorRegex.test(path)){
return `[${withoutSpace(path.trim())}]`
}
return path
})}
export function sortConditions(paths){
return paths.sort((a, b) => {
const aa = isCondition(a)
const bb = isCondition(b)
if (aa && !bb) return 1
if (!aa && bb) return -1
return 0
})
}

9
src/styled-system/css/css.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* eslint-disable */
import type { SystemStyleObject } from '../types'
interface CssFunction {
(...styles: SystemStyleObject[]): string
raw: (styles: SystemStyleObject) => SystemStyleObject
}
export declare const css: CssFunction;

File diff suppressed because one or more lines are too long

6
src/styled-system/css/cva.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
/* eslint-disable */
import type { RecipeCreatorFn } from '../types/recipe'
export declare const cva: RecipeCreatorFn
export type { RecipeVariantProps } from '../types/recipe'

View File

@ -0,0 +1,63 @@
import { compact, splitProps } from '../helpers.mjs';
import { css, mergeCss } from './css.mjs';
export function cva(config) {
const { base = {}, variants = {}, defaultVariants = {}, compoundVariants = [] } = config
function resolve(props = {}) {
const computedVariants = { ...defaultVariants, ...compact(props) }
let variantCss = { ...base }
for (const [key, value] of Object.entries(computedVariants)) {
if (variants[key]?.[value]) {
variantCss = mergeCss(variantCss, variants[key][value])
}
}
const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants)
return mergeCss(variantCss, compoundVariantCss)
}
function cvaFn(props) {
return css(resolve(props))
}
const variantKeys = Object.keys(variants)
function splitVariantProps(props) {
return splitProps(props, variantKeys)
}
const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
return Object.assign(cvaFn, {
__cva__: true,
variantMap,
variantKeys,
raw: resolve,
config,
splitVariantProps,
})
}
export function getCompoundVariantCss(compoundVariants, variantMap) {
let result = {}
compoundVariants.forEach((compoundVariant) => {
const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
if (key === 'css') return true
const values = Array.isArray(value) ? value : [value]
return values.some((value) => variantMap[key] === value)
})
if (isMatching) {
result = mergeCss(result, compoundVariant.css)
}
})
return result
}
export function assertCompoundVariant(name, compoundVariants, variants, prop) {
if (compoundVariants.length > 0 && typeof variants[prop] === 'object') {
throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
}
}

5
src/styled-system/css/cx.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/* eslint-disable */
type Argument = string | boolean | null | undefined
/** Conditionally join classNames into a single string */
export declare function cx(...args: Argument[]): string

View File

@ -0,0 +1,15 @@
function cx() {
let str = '',
i = 0,
arg
for (; i < arguments.length; ) {
if ((arg = arguments[i++]) && typeof arg === 'string') {
str && (str += ' ')
str += arg
}
}
return str
}
export { cx }

5
src/styled-system/css/index.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/* eslint-disable */
export * from './css'
export * from './cx'
export * from './cva'
export * from './sva'

View File

@ -0,0 +1,4 @@
export * from './css.mjs';
export * from './cx.mjs';
export * from './cva.mjs';
export * from './sva.mjs';

4
src/styled-system/css/sva.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/* eslint-disable */
import type { SlotRecipeCreatorFn } from '../types/recipe'
export declare const sva: SlotRecipeCreatorFn

View File

@ -0,0 +1,29 @@
import { getSlotRecipes, splitProps } from '../helpers.mjs';
import { cva } from './cva.mjs';
export function sva(config) {
const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
function svaFn(props) {
const result = slots.map(([slot, cvaFn]) => [slot, cvaFn(props)])
return Object.fromEntries(result)
}
const variants = config.variants ?? {};
const variantKeys = Object.keys(variants);
function splitVariantProps(props) {
return splitProps(props, variantKeys);
}
const variantMap = Object.fromEntries(
Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
);
return Object.assign(svaFn, {
__cva__: false,
variantMap,
variantKeys,
splitVariantProps,
})
}

View File

@ -0,0 +1,36 @@
@layer base {
:root {
--made-with-panda: '🐼'
}
*, *::before, *::after, ::backdrop {
--blur: ;
--brightness: ;
--contrast: ;
--grayscale: ;
--hue-rotate: ;
--invert: ;
--saturate: ;
--sepia: ;
--drop-shadow: ;
--backdrop-blur: ;
--backdrop-brightness: ;
--backdrop-contrast: ;
--backdrop-grayscale: ;
--backdrop-hue-rotate: ;
--backdrop-invert: ;
--backdrop-opacity: ;
--backdrop-saturate: ;
--backdrop-sepia: ;
--scroll-snap-strictness: proximity;
--border-spacing-x: 0;
--border-spacing-y: 0;
--translate-x: 0;
--translate-y: 0;
--rotate: 0;
--skew-x: 0;
--skew-y: 0;
--scale-x: 1;
--scale-y: 1
}
}

View File

@ -0,0 +1,306 @@
// src/assert.ts
function isObject(value) {
return typeof value === "object" && value != null && !Array.isArray(value);
}
// src/compact.ts
function compact(value) {
return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
}
// src/condition.ts
var isBaseCondition = (v) => v === "base";
function filterBaseConditions(c) {
return c.slice().filter((v) => !isBaseCondition(v));
}
// src/css-important.ts
var importantRegex = /!(important)?$/;
function isImportant(value) {
return typeof value === "string" ? importantRegex.test(value) : false;
}
function withoutImportant(value) {
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
}
function withoutSpace(str) {
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
}
// src/hash.ts
function toChar(code) {
return String.fromCharCode(code + (code > 25 ? 39 : 97));
}
function toName(code) {
let name = "";
let x;
for (x = Math.abs(code); x > 52; x = x / 52 | 0)
name = toChar(x % 52) + name;
return toChar(x % 52) + name;
}
function toPhash(h, x) {
let i = x.length;
while (i)
h = h * 33 ^ x.charCodeAt(--i);
return h;
}
function toHash(value) {
return toName(toPhash(5381, value) >>> 0);
}
// src/merge-props.ts
function mergeProps(...sources) {
const result = {};
for (const source of sources) {
for (const [key, value] of Object.entries(source)) {
if (isObject(value)) {
result[key] = mergeProps(result[key] || {}, value);
} else {
result[key] = value;
}
}
}
return result;
}
// src/walk-object.ts
var isNotNullish = (element) => element != null;
function walkObject(target, predicate, options = {}) {
const { stop, getKey } = options;
function inner(value, path = []) {
if (isObject(value) || Array.isArray(value)) {
const result = {};
for (const [prop, child] of Object.entries(value)) {
const key = getKey?.(prop) ?? prop;
const childPath = [...path, key];
if (stop?.(value, childPath)) {
return predicate(value, path);
}
const next = inner(child, childPath);
if (isNotNullish(next)) {
result[key] = next;
}
}
return result;
}
return predicate(value, path);
}
return inner(target);
}
function mapObject(obj, fn) {
if (!isObject(obj))
return fn(obj);
return walkObject(obj, (value) => fn(value));
}
// src/normalize-style-object.ts
function toResponsiveObject(values, breakpoints) {
return values.reduce((acc, current, index) => {
const key = breakpoints[index];
if (current != null) {
acc[key] = current;
}
return acc;
}, {});
}
function normalizeShorthand(styles, context) {
const { hasShorthand, resolveShorthand } = context.utility;
return walkObject(styles, (v) => v, {
getKey: (prop) => {
return hasShorthand ? resolveShorthand(prop) : prop;
}
});
}
function normalizeStyleObject(styles, context) {
const { utility, conditions } = context;
const { hasShorthand, resolveShorthand } = utility;
return walkObject(
styles,
(value) => {
return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
},
{
stop: (value) => Array.isArray(value),
getKey: (prop) => {
return hasShorthand ? resolveShorthand(prop) : prop;
}
}
);
}
// src/classname.ts
var fallbackCondition = {
shift: (v) => v,
finalize: (v) => v,
breakpoints: { keys: [] }
};
var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
function createCss(context) {
const { utility, hash, conditions: conds = fallbackCondition } = context;
const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
const hashFn = (conditions, className) => {
let result;
if (hash) {
const baseArray = [...conds.finalize(conditions), className];
result = formatClassName(toHash(baseArray.join(":")));
} else {
const baseArray = [...conds.finalize(conditions), formatClassName(className)];
result = baseArray.join(":");
}
return result;
};
return (styleObject = {}) => {
const normalizedObject = normalizeStyleObject(styleObject, context);
const classNames = /* @__PURE__ */ new Set();
walkObject(normalizedObject, (value, paths) => {
const important = isImportant(value);
if (value == null)
return;
const [prop, ...allConditions] = conds.shift(paths);
const conditions = filterBaseConditions(allConditions);
const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
let className = hashFn(conditions, transformed.className);
if (important)
className = `${className}!`;
classNames.add(className);
});
return Array.from(classNames).join(" ");
};
}
function compactStyles(...styles) {
return styles.filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
}
function createMergeCss(context) {
function resolve(styles) {
const allStyles = compactStyles(...styles);
if (allStyles.length === 1)
return allStyles;
return allStyles.map((style) => normalizeShorthand(style, context));
}
function mergeCss(...styles) {
return mergeProps(...resolve(styles));
}
function assignCss(...styles) {
return Object.assign({}, ...resolve(styles));
}
return { mergeCss, assignCss };
}
// src/memo.ts
var memo = (fn) => {
const cache = /* @__PURE__ */ new Map();
const get = (...args) => {
const key = JSON.stringify(args);
if (cache.has(key)) {
return cache.get(key);
}
const result = fn(...args);
cache.set(key, result);
return result;
};
return get;
};
// src/hypenate-property.ts
var wordRegex = /([A-Z])/g;
var msRegex = /^ms-/;
var hypenateProperty = memo((property) => {
if (property.startsWith("--"))
return property;
return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
});
// src/slot.ts
var assign = (obj, path, value) => {
const last = path.pop();
const target = path.reduce((acc, key) => {
if (acc[key] == null)
acc[key] = {};
return acc[key];
}, obj);
if (last != null)
target[last] = value;
};
var getSlotRecipes = (recipe) => {
const parts = recipe.slots.map((slot) => [
slot,
// setup base recipe
{
// create class-base on BEM
className: [recipe.className ?? "", slot].join("__"),
base: {},
variants: {},
defaultVariants: recipe.defaultVariants ?? {},
compoundVariants: []
}
]).map(([slot, cva]) => {
const base = recipe.base[slot];
if (base)
cva.base = base;
walkObject(
recipe.variants ?? {},
(variant, path) => {
if (!variant[slot])
return;
assign(cva, ["variants", ...path], variant[slot]);
},
{
stop: (_value, path) => path.includes(slot)
}
);
if (recipe.compoundVariants) {
cva.compoundVariants = getSlotCompoundVariant(recipe.compoundVariants, slot);
}
return [slot, cva];
});
return Object.fromEntries(parts);
};
var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
// src/split-props.ts
function splitProps(props, ...keys) {
const descriptors = Object.getOwnPropertyDescriptors(props);
const dKeys = Object.keys(descriptors);
const split = (k) => {
const clone = {};
for (let i = 0; i < k.length; i++) {
const key = k[i];
if (descriptors[key]) {
Object.defineProperty(clone, key, descriptors[key]);
delete descriptors[key];
}
}
return clone;
};
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
return keys.map(fn).concat(split(dKeys));
}
export {
compact,
createCss,
createMergeCss,
filterBaseConditions,
getSlotCompoundVariant,
getSlotRecipes,
hypenateProperty,
isBaseCondition,
isObject,
mapObject,
memo,
mergeProps,
splitProps,
toHash,
walkObject,
withoutSpace
};
export function __spreadValues(a, b) {
return { ...a, ...b }
}
export function __objRest(source, exclude) {
return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
}

View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type AspectRatioProperties = {
ratio?: ConditionalValue<number>
}
type AspectRatioStyles = AspectRatioProperties & DistributiveOmit<SystemStyleObject, keyof AspectRatioProperties | 'aspectRatio'>
interface AspectRatioPatternFn {
(styles?: AspectRatioStyles): string
raw: (styles: AspectRatioStyles) => SystemStyleObject
}
export declare const aspectRatio: AspectRatioPatternFn;

View File

@ -0,0 +1,35 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const aspectRatioConfig = {
transform(props, { map }) {
const { ratio = 4 / 3, ...rest } = props;
return {
position: "relative",
_before: {
content: `""`,
display: "block",
height: "0",
paddingBottom: map(ratio, (r) => `${1 / r * 100}%`)
},
"&>*": {
display: "flex",
justifyContent: "center",
alignItems: "center",
overflow: "hidden",
position: "absolute",
inset: "0",
width: "100%",
height: "100%"
},
"&>img, &>video": {
objectFit: "cover"
},
...rest
};
}}
export const getAspectRatioStyle = (styles = {}) => aspectRatioConfig.transform(styles, { map: mapObject })
export const aspectRatio = (styles) => css(getAspectRatioStyle(styles))
aspectRatio.raw = getAspectRatioStyle

22
src/styled-system/patterns/bleed.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type BleedProperties = {
inline?: PropertyValue<'marginInline'>
block?: PropertyValue<'marginBlock'>
}
type BleedStyles = BleedProperties & DistributiveOmit<SystemStyleObject, keyof BleedProperties >
interface BleedPatternFn {
(styles?: BleedStyles): string
raw: (styles: BleedStyles) => SystemStyleObject
}
export declare const bleed: BleedPatternFn;

View File

@ -0,0 +1,19 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const bleedConfig = {
transform(props) {
const { inline = "0", block = "0", ...rest } = props;
return {
"--bleed-x": `spacing.${inline}`,
"--bleed-y": `spacing.${block}`,
marginInline: "calc(var(--bleed-x, 0) * -1)",
marginBlock: "calc(var(--bleed-y, 0) * -1)",
...rest
};
}}
export const getBleedStyle = (styles = {}) => bleedConfig.transform(styles, { map: mapObject })
export const bleed = (styles) => css(getBleedStyle(styles))
bleed.raw = getBleedStyle

21
src/styled-system/patterns/box.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type BoxProperties = {
}
type BoxStyles = BoxProperties & DistributiveOmit<SystemStyleObject, keyof BoxProperties >
interface BoxPatternFn {
(styles?: BoxStyles): string
raw: (styles: BoxStyles) => SystemStyleObject
}
export declare const box: BoxPatternFn;

View File

@ -0,0 +1,12 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const boxConfig = {
transform(props) {
return props;
}}
export const getBoxStyle = (styles = {}) => boxConfig.transform(styles, { map: mapObject })
export const box = (styles) => css(getBoxStyle(styles))
box.raw = getBoxStyle

21
src/styled-system/patterns/center.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type CenterProperties = {
inline?: ConditionalValue<boolean>
}
type CenterStyles = CenterProperties & DistributiveOmit<SystemStyleObject, keyof CenterProperties >
interface CenterPatternFn {
(styles?: CenterStyles): string
raw: (styles: CenterStyles) => SystemStyleObject
}
export declare const center: CenterPatternFn;

View File

@ -0,0 +1,18 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const centerConfig = {
transform(props) {
const { inline, ...rest } = props;
return {
display: inline ? "inline-flex" : "flex",
alignItems: "center",
justifyContent: "center",
...rest
};
}}
export const getCenterStyle = (styles = {}) => centerConfig.transform(styles, { map: mapObject })
export const center = (styles) => css(getCenterStyle(styles))
center.raw = getCenterStyle

21
src/styled-system/patterns/circle.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type CircleProperties = {
size?: PropertyValue<'width'>
}
type CircleStyles = CircleProperties & DistributiveOmit<SystemStyleObject, keyof CircleProperties >
interface CirclePatternFn {
(styles?: CircleStyles): string
raw: (styles: CircleStyles) => SystemStyleObject
}
export declare const circle: CirclePatternFn;

View File

@ -0,0 +1,22 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const circleConfig = {
transform(props) {
const { size, ...rest } = props;
return {
display: "flex",
alignItems: "center",
justifyContent: "center",
flex: "0 0 auto",
width: size,
height: size,
borderRadius: "9999px",
...rest
};
}}
export const getCircleStyle = (styles = {}) => circleConfig.transform(styles, { map: mapObject })
export const circle = (styles) => css(getCircleStyle(styles))
circle.raw = getCircleStyle

View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type ContainerProperties = {
}
type ContainerStyles = ContainerProperties & DistributiveOmit<SystemStyleObject, keyof ContainerProperties >
interface ContainerPatternFn {
(styles?: ContainerStyles): string
raw: (styles: ContainerStyles) => SystemStyleObject
}
export declare const container: ContainerPatternFn;

View File

@ -0,0 +1,18 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const containerConfig = {
transform(props) {
return {
position: "relative",
maxWidth: "8xl",
mx: "auto",
px: { base: "4", md: "6", lg: "8" },
...props
};
}}
export const getContainerStyle = (styles = {}) => containerConfig.transform(styles, { map: mapObject })
export const container = (styles) => css(getContainerStyle(styles))
container.raw = getContainerStyle

23
src/styled-system/patterns/divider.d.ts vendored Normal file
View File

@ -0,0 +1,23 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type DividerProperties = {
orientation?: ConditionalValue<"horizontal" | "vertical">
thickness?: ConditionalValue<Tokens["sizes"] | Properties["borderWidth"]>
color?: ConditionalValue<Tokens["colors"] | Properties["borderColor"]>
}
type DividerStyles = DividerProperties & DistributiveOmit<SystemStyleObject, keyof DividerProperties >
interface DividerPatternFn {
(styles?: DividerStyles): string
raw: (styles: DividerStyles) => SystemStyleObject
}
export declare const divider: DividerPatternFn;

View File

@ -0,0 +1,21 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const dividerConfig = {
transform(props, { map }) {
const { orientation = "horizontal", thickness = "1px", color, ...rest } = props;
return {
"--thickness": thickness,
width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
height: map(orientation, (v) => v === "horizontal" ? void 0 : "100%"),
borderBlockEndWidth: map(orientation, (v) => v === "horizontal" ? "var(--thickness)" : void 0),
borderInlineEndWidth: map(orientation, (v) => v === "vertical" ? "var(--thickness)" : void 0),
borderColor: color,
...rest
};
}}
export const getDividerStyle = (styles = {}) => dividerConfig.transform(styles, { map: mapObject })
export const divider = (styles) => css(getDividerStyle(styles))
divider.raw = getDividerStyle

27
src/styled-system/patterns/flex.d.ts vendored Normal file
View File

@ -0,0 +1,27 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type FlexProperties = {
align?: PropertyValue<'alignItems'>
justify?: PropertyValue<'justifyContent'>
direction?: PropertyValue<'flexDirection'>
wrap?: PropertyValue<'flexWrap'>
basis?: PropertyValue<'flexBasis'>
grow?: PropertyValue<'flexGrow'>
shrink?: PropertyValue<'flexShrink'>
}
type FlexStyles = FlexProperties & DistributiveOmit<SystemStyleObject, keyof FlexProperties >
interface FlexPatternFn {
(styles?: FlexStyles): string
raw: (styles: FlexStyles) => SystemStyleObject
}
export declare const flex: FlexPatternFn;

View File

@ -0,0 +1,23 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const flexConfig = {
transform(props) {
const { direction, align, justify, wrap: wrap2, basis, grow, shrink, ...rest } = props;
return {
display: "flex",
flexDirection: direction,
alignItems: align,
justifyContent: justify,
flexWrap: wrap2,
flexBasis: basis,
flexGrow: grow,
flexShrink: shrink,
...rest
};
}}
export const getFlexStyle = (styles = {}) => flexConfig.transform(styles, { map: mapObject })
export const flex = (styles) => css(getFlexStyle(styles))
flex.raw = getFlexStyle

24
src/styled-system/patterns/float.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type FloatProperties = {
offsetX?: ConditionalValue<Tokens["spacing"] | Properties["left"]>
offsetY?: ConditionalValue<Tokens["spacing"] | Properties["top"]>
offset?: ConditionalValue<Tokens["spacing"] | Properties["top"]>
placement?: ConditionalValue<"bottom-end" | "bottom-start" | "top-end" | "top-start" | "bottom-center" | "top-center" | "middle-center" | "middle-end" | "middle-start">
}
type FloatStyles = FloatProperties & DistributiveOmit<SystemStyleObject, keyof FloatProperties >
interface FloatPatternFn {
(styles?: FloatStyles): string
raw: (styles: FloatStyles) => SystemStyleObject
}
export declare const float: FloatPatternFn;

View File

@ -0,0 +1,45 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const floatConfig = {
transform(props, { map }) {
const { offset = "0", offsetX = offset, offsetY = offset, placement = "top-end", ...rest } = props;
return {
display: "inline-flex",
justifyContent: "center",
alignItems: "center",
position: "absolute",
insetBlockStart: map(placement, (v) => {
const [side] = v.split("-");
const map2 = { top: offsetY, middle: "50%", bottom: "auto" };
return map2[side];
}),
insetBlockEnd: map(placement, (v) => {
const [side] = v.split("-");
const map2 = { top: "auto", middle: "50%", bottom: offsetY };
return map2[side];
}),
insetInlineStart: map(placement, (v) => {
const [, align] = v.split("-");
const map2 = { start: offsetX, center: "50%", end: "auto" };
return map2[align];
}),
insetInlineEnd: map(placement, (v) => {
const [, align] = v.split("-");
const map2 = { start: "auto", center: "50%", end: offsetX };
return map2[align];
}),
translate: map(placement, (v) => {
const [side, align] = v.split("-");
const mapX = { start: "-50%", center: "-50%", end: "50%" };
const mapY = { top: "-50%", middle: "-50%", bottom: "50%" };
return `${mapX[align]} ${mapY[side]}`;
}),
...rest
};
}}
export const getFloatStyle = (styles = {}) => floatConfig.transform(styles, { map: mapObject })
export const float = (styles) => css(getFloatStyle(styles))
float.raw = getFloatStyle

View File

@ -0,0 +1,26 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type GridItemProperties = {
colSpan?: ConditionalValue<number>
rowSpan?: ConditionalValue<number>
colStart?: ConditionalValue<number>
rowStart?: ConditionalValue<number>
colEnd?: ConditionalValue<number>
rowEnd?: ConditionalValue<number>
}
type GridItemStyles = GridItemProperties & DistributiveOmit<SystemStyleObject, keyof GridItemProperties >
interface GridItemPatternFn {
(styles?: GridItemStyles): string
raw: (styles: GridItemStyles) => SystemStyleObject
}
export declare const gridItem: GridItemPatternFn;

View File

@ -0,0 +1,22 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const gridItemConfig = {
transform(props, { map }) {
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props;
const spanFn = (v) => v === "auto" ? v : `span ${v}`;
return {
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
gridRow: rowSpan != null ? map(rowSpan, spanFn) : void 0,
gridColumnStart: colStart,
gridColumnEnd: colEnd,
gridRowStart: rowStart,
gridRowEnd: rowEnd,
...rest
};
}}
export const getGridItemStyle = (styles = {}) => gridItemConfig.transform(styles, { map: mapObject })
export const gridItem = (styles) => css(getGridItemStyle(styles))
gridItem.raw = getGridItemStyle

25
src/styled-system/patterns/grid.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type GridProperties = {
gap?: PropertyValue<'gap'>
columnGap?: PropertyValue<'gap'>
rowGap?: PropertyValue<'gap'>
columns?: ConditionalValue<number>
minChildWidth?: ConditionalValue<Tokens["sizes"] | Properties["width"]>
}
type GridStyles = GridProperties & DistributiveOmit<SystemStyleObject, keyof GridProperties >
interface GridPatternFn {
(styles?: GridStyles): string
raw: (styles: GridStyles) => SystemStyleObject
}
export declare const grid: GridPatternFn;

View File

@ -0,0 +1,20 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const gridConfig = {
transform(props, { map }) {
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", columns, minChildWidth, ...rest } = props;
return {
display: "grid",
gridTemplateColumns: columns != null ? map(columns, (v) => `repeat(${v}, minmax(0, 1fr))`) : minChildWidth != null ? map(minChildWidth, (v) => `repeat(auto-fit, minmax(${v}, 1fr))`) : void 0,
gap,
columnGap,
rowGap,
...rest
};
}}
export const getGridStyle = (styles = {}) => gridConfig.transform(styles, { map: mapObject })
export const grid = (styles) => css(getGridStyle(styles))
grid.raw = getGridStyle

22
src/styled-system/patterns/hstack.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type HstackProperties = {
justify?: PropertyValue<'justifyContent'>
gap?: PropertyValue<'gap'>
}
type HstackStyles = HstackProperties & DistributiveOmit<SystemStyleObject, keyof HstackProperties >
interface HstackPatternFn {
(styles?: HstackStyles): string
raw: (styles: HstackStyles) => SystemStyleObject
}
export declare const hstack: HstackPatternFn;

View File

@ -0,0 +1,20 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const hstackConfig = {
transform(props) {
const { justify, gap = "10px", ...rest } = props;
return {
display: "flex",
alignItems: "center",
justifyContent: justify,
gap,
flexDirection: "row",
...rest
};
}}
export const getHstackStyle = (styles = {}) => hstackConfig.transform(styles, { map: mapObject })
export const hstack = (styles) => css(getHstackStyle(styles))
hstack.raw = getHstackStyle

21
src/styled-system/patterns/index.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* eslint-disable */
export * from './box'
export * from './flex'
export * from './stack'
export * from './vstack'
export * from './hstack'
export * from './spacer'
export * from './square'
export * from './circle'
export * from './center'
export * from './link-box'
export * from './link-overlay'
export * from './aspect-ratio'
export * from './grid'
export * from './grid-item'
export * from './wrap'
export * from './container'
export * from './divider'
export * from './float'
export * from './bleed'
export * from './visually-hidden'

View File

@ -0,0 +1,20 @@
export * from './box.mjs';
export * from './flex.mjs';
export * from './stack.mjs';
export * from './vstack.mjs';
export * from './hstack.mjs';
export * from './spacer.mjs';
export * from './square.mjs';
export * from './circle.mjs';
export * from './center.mjs';
export * from './link-box.mjs';
export * from './link-overlay.mjs';
export * from './aspect-ratio.mjs';
export * from './grid.mjs';
export * from './grid-item.mjs';
export * from './wrap.mjs';
export * from './container.mjs';
export * from './divider.mjs';
export * from './float.mjs';
export * from './bleed.mjs';
export * from './visually-hidden.mjs';

View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type LinkBoxProperties = {
}
type LinkBoxStyles = LinkBoxProperties & DistributiveOmit<SystemStyleObject, keyof LinkBoxProperties >
interface LinkBoxPatternFn {
(styles?: LinkBoxStyles): string
raw: (styles: LinkBoxStyles) => SystemStyleObject
}
export declare const linkBox: LinkBoxPatternFn;

View File

@ -0,0 +1,19 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const linkBoxConfig = {
transform(props) {
return {
position: "relative",
"& :where(a, abbr)": {
position: "relative",
zIndex: "1"
},
...props
};
}}
export const getLinkBoxStyle = (styles = {}) => linkBoxConfig.transform(styles, { map: mapObject })
export const linkBox = (styles) => css(getLinkBoxStyle(styles))
linkBox.raw = getLinkBoxStyle

View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type LinkOverlayProperties = {
}
type LinkOverlayStyles = LinkOverlayProperties & DistributiveOmit<SystemStyleObject, keyof LinkOverlayProperties >
interface LinkOverlayPatternFn {
(styles?: LinkOverlayStyles): string
raw: (styles: LinkOverlayStyles) => SystemStyleObject
}
export declare const linkOverlay: LinkOverlayPatternFn;

View File

@ -0,0 +1,24 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const linkOverlayConfig = {
transform(props) {
return {
position: "static",
_before: {
content: '""',
display: "block",
position: "absolute",
cursor: "inherit",
inset: "0",
zIndex: "0",
...props["_before"]
},
...props
};
}}
export const getLinkOverlayStyle = (styles = {}) => linkOverlayConfig.transform(styles, { map: mapObject })
export const linkOverlay = (styles) => css(getLinkOverlayStyle(styles))
linkOverlay.raw = getLinkOverlayStyle

21
src/styled-system/patterns/spacer.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type SpacerProperties = {
size?: ConditionalValue<Tokens["spacing"]>
}
type SpacerStyles = SpacerProperties & DistributiveOmit<SystemStyleObject, keyof SpacerProperties >
interface SpacerPatternFn {
(styles?: SpacerStyles): string
raw: (styles: SpacerStyles) => SystemStyleObject
}
export declare const spacer: SpacerPatternFn;

View File

@ -0,0 +1,18 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const spacerConfig = {
transform(props, { map }) {
const { size, ...rest } = props;
return {
alignSelf: "stretch",
justifySelf: "stretch",
flex: map(size, (v) => v == null ? "1" : `0 0 ${v}`),
...rest
};
}}
export const getSpacerStyle = (styles = {}) => spacerConfig.transform(styles, { map: mapObject })
export const spacer = (styles) => css(getSpacerStyle(styles))
spacer.raw = getSpacerStyle

21
src/styled-system/patterns/square.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type SquareProperties = {
size?: PropertyValue<'width'>
}
type SquareStyles = SquareProperties & DistributiveOmit<SystemStyleObject, keyof SquareProperties >
interface SquarePatternFn {
(styles?: SquareStyles): string
raw: (styles: SquareStyles) => SystemStyleObject
}
export declare const square: SquarePatternFn;

View File

@ -0,0 +1,21 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const squareConfig = {
transform(props) {
const { size, ...rest } = props;
return {
display: "flex",
alignItems: "center",
justifyContent: "center",
flex: "0 0 auto",
width: size,
height: size,
...rest
};
}}
export const getSquareStyle = (styles = {}) => squareConfig.transform(styles, { map: mapObject })
export const square = (styles) => css(getSquareStyle(styles))
square.raw = getSquareStyle

24
src/styled-system/patterns/stack.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type StackProperties = {
align?: PropertyValue<'alignItems'>
justify?: PropertyValue<'justifyContent'>
direction?: PropertyValue<'flexDirection'>
gap?: PropertyValue<'gap'>
}
type StackStyles = StackProperties & DistributiveOmit<SystemStyleObject, keyof StackProperties >
interface StackPatternFn {
(styles?: StackStyles): string
raw: (styles: StackStyles) => SystemStyleObject
}
export declare const stack: StackPatternFn;

View File

@ -0,0 +1,20 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const stackConfig = {
transform(props) {
const { align, justify, direction = "column", gap = "10px", ...rest } = props;
return {
display: "flex",
flexDirection: direction,
alignItems: align,
justifyContent: justify,
gap,
...rest
};
}}
export const getStackStyle = (styles = {}) => stackConfig.transform(styles, { map: mapObject })
export const stack = (styles) => css(getStackStyle(styles))
stack.raw = getStackStyle

View File

@ -0,0 +1,21 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type VisuallyHiddenProperties = {
}
type VisuallyHiddenStyles = VisuallyHiddenProperties & DistributiveOmit<SystemStyleObject, keyof VisuallyHiddenProperties >
interface VisuallyHiddenPatternFn {
(styles?: VisuallyHiddenStyles): string
raw: (styles: VisuallyHiddenStyles) => SystemStyleObject
}
export declare const visuallyHidden: VisuallyHiddenPatternFn;

View File

@ -0,0 +1,15 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const visuallyHiddenConfig = {
transform(props) {
return {
srOnly: true,
...props
};
}}
export const getVisuallyHiddenStyle = (styles = {}) => visuallyHiddenConfig.transform(styles, { map: mapObject })
export const visuallyHidden = (styles) => css(getVisuallyHiddenStyle(styles))
visuallyHidden.raw = getVisuallyHiddenStyle

22
src/styled-system/patterns/vstack.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type VstackProperties = {
justify?: PropertyValue<'justifyContent'>
gap?: PropertyValue<'gap'>
}
type VstackStyles = VstackProperties & DistributiveOmit<SystemStyleObject, keyof VstackProperties >
interface VstackPatternFn {
(styles?: VstackStyles): string
raw: (styles: VstackStyles) => SystemStyleObject
}
export declare const vstack: VstackPatternFn;

View File

@ -0,0 +1,20 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const vstackConfig = {
transform(props) {
const { justify, gap = "10px", ...rest } = props;
return {
display: "flex",
alignItems: "center",
justifyContent: justify,
gap,
flexDirection: "column",
...rest
};
}}
export const getVstackStyle = (styles = {}) => vstackConfig.transform(styles, { map: mapObject })
export const vstack = (styles) => css(getVstackStyle(styles))
vstack.raw = getVstackStyle

25
src/styled-system/patterns/wrap.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
/* eslint-disable */
import type { SystemStyleObject, ConditionalValue } from '../types'
import type { Properties } from '../types/csstype'
import type { PropertyValue } from '../types/prop-type'
import type { DistributiveOmit } from '../types/system-types'
import type { Tokens } from '../tokens'
export type WrapProperties = {
gap?: PropertyValue<'gap'>
rowGap?: PropertyValue<'gap'>
columnGap?: PropertyValue<'gap'>
align?: PropertyValue<'alignItems'>
justify?: PropertyValue<'justifyContent'>
}
type WrapStyles = WrapProperties & DistributiveOmit<SystemStyleObject, keyof WrapProperties >
interface WrapPatternFn {
(styles?: WrapStyles): string
raw: (styles: WrapStyles) => SystemStyleObject
}
export declare const wrap: WrapPatternFn;

View File

@ -0,0 +1,22 @@
import { mapObject } from '../helpers.mjs';
import { css } from '../css/index.mjs';
const wrapConfig = {
transform(props) {
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props;
return {
display: "flex",
flexWrap: "wrap",
alignItems: align,
justifyContent: justify,
gap,
columnGap,
rowGap,
...rest
};
}}
export const getWrapStyle = (styles = {}) => wrapConfig.transform(styles, { map: mapObject })
export const wrap = (styles) => css(getWrapStyle(styles))
wrap.raw = getWrapStyle

191
src/styled-system/reset.css Normal file
View File

@ -0,0 +1,191 @@
@layer reset {
* {
margin: 0;
padding: 0;
font: inherit;
}
*,
*::before,
*::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: var(--global-color-border, currentColor);
}
html {
line-height: 1.5;
--font-fallback: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
-webkit-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-tab-size: 4;
tab-size: 4;
font-family: var(--global-font-body, var(--font-fallback));
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
body {
height: 100%;
line-height: inherit;
}
img {
border-style: none;
}
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block;
vertical-align: middle;
}
img,
video {
max-width: 100%;
height: auto;
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
overflow-wrap: break-word;
}
ol,
ul {
list-style: none;
}
code,
kbd,
pre,
samp {
font-size: 1em;
}
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
background-color: transparent;
background-image: none;
}
button,
select {
text-transform: none;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
input::placeholder,
textarea::placeholder {
opacity: 1;
color: var(--global-color-placeholder, #9ca3af);
}
textarea {
resize: vertical;
}
summary {
display: list-item;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
dialog {
padding: 0;
}
a {
color: inherit;
text-decoration: inherit;
}
abbr:where([title]) {
text-decoration: underline dotted;
}
b,
strong {
font-weight: bolder;
}
code,
kbd,
samp,
pre {
font-size: 1em;
--font-mono-fallback: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New';
font-family: var(--global-font-mono, var(--font-fallback));
}
[type='search'] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
:-moz-ui-invalid {
box-shadow: none;
}
:-moz-focusring {
outline: auto;
}
}

View File

@ -0,0 +1,423 @@
@layer tokens {
:where(:root, :host) {
--borders-none: none;
--easings-default: cubic-bezier(0.4, 0, 0.2, 1);
--easings-linear: linear;
--easings-in: cubic-bezier(0.4, 0, 1, 1);
--easings-out: cubic-bezier(0, 0, 0.2, 1);
--easings-in-out: cubic-bezier(0.4, 0, 0.2, 1);
--durations-fastest: 50ms;
--durations-faster: 100ms;
--durations-fast: 150ms;
--durations-normal: 200ms;
--durations-slow: 300ms;
--durations-slower: 400ms;
--durations-slowest: 500ms;
--radii-xs: 0.125rem;
--radii-sm: 0.25rem;
--radii-md: 0.375rem;
--radii-lg: 0.5rem;
--radii-xl: 0.75rem;
--radii-2xl: 1rem;
--radii-3xl: 1.5rem;
--radii-full: 9999px;
--font-weights-thin: 100;
--font-weights-extralight: 200;
--font-weights-light: 300;
--font-weights-normal: 400;
--font-weights-medium: 500;
--font-weights-semibold: 600;
--font-weights-bold: 700;
--font-weights-extrabold: 800;
--font-weights-black: 900;
--line-heights-none: 1;
--line-heights-tight: 1.25;
--line-heights-snug: 1.375;
--line-heights-normal: 1.5;
--line-heights-relaxed: 1.625;
--line-heights-loose: 2;
--fonts-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--fonts-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
--fonts-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--letter-spacings-tighter: -0.05em;
--letter-spacings-tight: -0.025em;
--letter-spacings-normal: 0em;
--letter-spacings-wide: 0.025em;
--letter-spacings-wider: 0.05em;
--letter-spacings-widest: 0.1em;
--font-sizes-2xs: 0.5rem;
--font-sizes-xs: 0.75rem;
--font-sizes-sm: 0.875rem;
--font-sizes-md: 1rem;
--font-sizes-lg: 1.125rem;
--font-sizes-xl: 1.25rem;
--font-sizes-2xl: 1.5rem;
--font-sizes-3xl: 1.875rem;
--font-sizes-4xl: 2.25rem;
--font-sizes-5xl: 3rem;
--font-sizes-6xl: 3.75rem;
--font-sizes-7xl: 4.5rem;
--font-sizes-8xl: 6rem;
--font-sizes-9xl: 8rem;
--shadows-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadows-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--shadows-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--shadows-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--shadows-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
--shadows-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
--shadows-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
--colors-current: currentColor;
--colors-black: #000;
--colors-white: #fff;
--colors-transparent: rgb(0 0 0 / 0);
--colors-rose-50: #fff1f2;
--colors-rose-100: #ffe4e6;
--colors-rose-200: #fecdd3;
--colors-rose-300: #fda4af;
--colors-rose-400: #fb7185;
--colors-rose-500: #f43f5e;
--colors-rose-600: #e11d48;
--colors-rose-700: #be123c;
--colors-rose-800: #9f1239;
--colors-rose-900: #881337;
--colors-rose-950: #4c0519;
--colors-pink-50: #fdf2f8;
--colors-pink-100: #fce7f3;
--colors-pink-200: #fbcfe8;
--colors-pink-300: #f9a8d4;
--colors-pink-400: #f472b6;
--colors-pink-500: #ec4899;
--colors-pink-600: #db2777;
--colors-pink-700: #be185d;
--colors-pink-800: #9d174d;
--colors-pink-900: #831843;
--colors-pink-950: #500724;
--colors-fuchsia-50: #fdf4ff;
--colors-fuchsia-100: #fae8ff;
--colors-fuchsia-200: #f5d0fe;
--colors-fuchsia-300: #f0abfc;
--colors-fuchsia-400: #e879f9;
--colors-fuchsia-500: #d946ef;
--colors-fuchsia-600: #c026d3;
--colors-fuchsia-700: #a21caf;
--colors-fuchsia-800: #86198f;
--colors-fuchsia-900: #701a75;
--colors-fuchsia-950: #4a044e;
--colors-purple-50: #faf5ff;
--colors-purple-100: #f3e8ff;
--colors-purple-200: #e9d5ff;
--colors-purple-300: #d8b4fe;
--colors-purple-400: #c084fc;
--colors-purple-500: #a855f7;
--colors-purple-600: #9333ea;
--colors-purple-700: #7e22ce;
--colors-purple-800: #6b21a8;
--colors-purple-900: #581c87;
--colors-purple-950: #3b0764;
--colors-violet-50: #f5f3ff;
--colors-violet-100: #ede9fe;
--colors-violet-200: #ddd6fe;
--colors-violet-300: #c4b5fd;
--colors-violet-400: #a78bfa;
--colors-violet-500: #8b5cf6;
--colors-violet-600: #7c3aed;
--colors-violet-700: #6d28d9;
--colors-violet-800: #5b21b6;
--colors-violet-900: #4c1d95;
--colors-violet-950: #2e1065;
--colors-indigo-50: #eef2ff;
--colors-indigo-100: #e0e7ff;
--colors-indigo-200: #c7d2fe;
--colors-indigo-300: #a5b4fc;
--colors-indigo-400: #818cf8;
--colors-indigo-500: #6366f1;
--colors-indigo-600: #4f46e5;
--colors-indigo-700: #4338ca;
--colors-indigo-800: #3730a3;
--colors-indigo-900: #312e81;
--colors-indigo-950: #1e1b4b;
--colors-blue-50: #eff6ff;
--colors-blue-100: #dbeafe;
--colors-blue-200: #bfdbfe;
--colors-blue-300: #93c5fd;
--colors-blue-400: #60a5fa;
--colors-blue-500: #3b82f6;
--colors-blue-600: #2563eb;
--colors-blue-700: #1d4ed8;
--colors-blue-800: #1e40af;
--colors-blue-900: #1e3a8a;
--colors-blue-950: #172554;
--colors-sky-50: #f0f9ff;
--colors-sky-100: #e0f2fe;
--colors-sky-200: #bae6fd;
--colors-sky-300: #7dd3fc;
--colors-sky-400: #38bdf8;
--colors-sky-500: #0ea5e9;
--colors-sky-600: #0284c7;
--colors-sky-700: #0369a1;
--colors-sky-800: #075985;
--colors-sky-900: #0c4a6e;
--colors-sky-950: #082f49;
--colors-cyan-50: #ecfeff;
--colors-cyan-100: #cffafe;
--colors-cyan-200: #a5f3fc;
--colors-cyan-300: #67e8f9;
--colors-cyan-400: #22d3ee;
--colors-cyan-500: #06b6d4;
--colors-cyan-600: #0891b2;
--colors-cyan-700: #0e7490;
--colors-cyan-800: #155e75;
--colors-cyan-900: #164e63;
--colors-cyan-950: #083344;
--colors-teal-50: #f0fdfa;
--colors-teal-100: #ccfbf1;
--colors-teal-200: #99f6e4;
--colors-teal-300: #5eead4;
--colors-teal-400: #2dd4bf;
--colors-teal-500: #14b8a6;
--colors-teal-600: #0d9488;
--colors-teal-700: #0f766e;
--colors-teal-800: #115e59;
--colors-teal-900: #134e4a;
--colors-teal-950: #042f2e;
--colors-emerald-50: #ecfdf5;
--colors-emerald-100: #d1fae5;
--colors-emerald-200: #a7f3d0;
--colors-emerald-300: #6ee7b7;
--colors-emerald-400: #34d399;
--colors-emerald-500: #10b981;
--colors-emerald-600: #059669;
--colors-emerald-700: #047857;
--colors-emerald-800: #065f46;
--colors-emerald-900: #064e3b;
--colors-emerald-950: #022c22;
--colors-green-50: #f0fdf4;
--colors-green-100: #dcfce7;
--colors-green-200: #bbf7d0;
--colors-green-300: #86efac;
--colors-green-400: #4ade80;
--colors-green-500: #22c55e;
--colors-green-600: #16a34a;
--colors-green-700: #15803d;
--colors-green-800: #166534;
--colors-green-900: #14532d;
--colors-green-950: #052e16;
--colors-lime-50: #f7fee7;
--colors-lime-100: #ecfccb;
--colors-lime-200: #d9f99d;
--colors-lime-300: #bef264;
--colors-lime-400: #a3e635;
--colors-lime-500: #84cc16;
--colors-lime-600: #65a30d;
--colors-lime-700: #4d7c0f;
--colors-lime-800: #3f6212;
--colors-lime-900: #365314;
--colors-lime-950: #1a2e05;
--colors-yellow-50: #fefce8;
--colors-yellow-100: #fef9c3;
--colors-yellow-200: #fef08a;
--colors-yellow-300: #fde047;
--colors-yellow-400: #facc15;
--colors-yellow-500: #eab308;
--colors-yellow-600: #ca8a04;
--colors-yellow-700: #a16207;
--colors-yellow-800: #854d0e;
--colors-yellow-900: #713f12;
--colors-yellow-950: #422006;
--colors-amber-50: #fffbeb;
--colors-amber-100: #fef3c7;
--colors-amber-200: #fde68a;
--colors-amber-300: #fcd34d;
--colors-amber-400: #fbbf24;
--colors-amber-500: #f59e0b;
--colors-amber-600: #d97706;
--colors-amber-700: #b45309;
--colors-amber-800: #92400e;
--colors-amber-900: #78350f;
--colors-amber-950: #451a03;
--colors-orange-50: #fff7ed;
--colors-orange-100: #ffedd5;
--colors-orange-200: #fed7aa;
--colors-orange-300: #fdba74;
--colors-orange-400: #fb923c;
--colors-orange-500: #f97316;
--colors-orange-600: #ea580c;
--colors-orange-700: #c2410c;
--colors-orange-800: #9a3412;
--colors-orange-900: #7c2d12;
--colors-orange-950: #431407;
--colors-red-50: #fef2f2;
--colors-red-100: #fee2e2;
--colors-red-200: #fecaca;
--colors-red-300: #fca5a5;
--colors-red-400: #f87171;
--colors-red-500: #ef4444;
--colors-red-600: #dc2626;
--colors-red-700: #b91c1c;
--colors-red-800: #991b1b;
--colors-red-900: #7f1d1d;
--colors-red-950: #450a0a;
--colors-neutral-50: #fafafa;
--colors-neutral-100: #f5f5f5;
--colors-neutral-200: #e5e5e5;
--colors-neutral-300: #d4d4d4;
--colors-neutral-400: #a3a3a3;
--colors-neutral-500: #737373;
--colors-neutral-600: #525252;
--colors-neutral-700: #404040;
--colors-neutral-800: #262626;
--colors-neutral-900: #171717;
--colors-neutral-950: #0a0a0a;
--colors-stone-50: #fafaf9;
--colors-stone-100: #f5f5f4;
--colors-stone-200: #e7e5e4;
--colors-stone-300: #d6d3d1;
--colors-stone-400: #a8a29e;
--colors-stone-500: #78716c;
--colors-stone-600: #57534e;
--colors-stone-700: #44403c;
--colors-stone-800: #292524;
--colors-stone-900: #1c1917;
--colors-stone-950: #0c0a09;
--colors-zinc-50: #fafafa;
--colors-zinc-100: #f4f4f5;
--colors-zinc-200: #e4e4e7;
--colors-zinc-300: #d4d4d8;
--colors-zinc-400: #a1a1aa;
--colors-zinc-500: #71717a;
--colors-zinc-600: #52525b;
--colors-zinc-700: #3f3f46;
--colors-zinc-800: #27272a;
--colors-zinc-900: #18181b;
--colors-zinc-950: #09090b;
--colors-gray-50: #f9fafb;
--colors-gray-100: #f3f4f6;
--colors-gray-200: #e5e7eb;
--colors-gray-300: #d1d5db;
--colors-gray-400: #9ca3af;
--colors-gray-500: #6b7280;
--colors-gray-600: #4b5563;
--colors-gray-700: #374151;
--colors-gray-800: #1f2937;
--colors-gray-900: #111827;
--colors-gray-950: #030712;
--colors-slate-50: #f8fafc;
--colors-slate-100: #f1f5f9;
--colors-slate-200: #e2e8f0;
--colors-slate-300: #cbd5e1;
--colors-slate-400: #94a3b8;
--colors-slate-500: #64748b;
--colors-slate-600: #475569;
--colors-slate-700: #334155;
--colors-slate-800: #1e293b;
--colors-slate-900: #0f172a;
--colors-slate-950: #020617;
--blurs-sm: 4px;
--blurs-base: 8px;
--blurs-md: 12px;
--blurs-lg: 16px;
--blurs-xl: 24px;
--blurs-2xl: 40px;
--blurs-3xl: 64px;
--spacing-0: 0rem;
--spacing-1: 0.25rem;
--spacing-2: 0.5rem;
--spacing-3: 0.75rem;
--spacing-4: 1rem;
--spacing-5: 1.25rem;
--spacing-6: 1.5rem;
--spacing-7: 1.75rem;
--spacing-8: 2rem;
--spacing-9: 2.25rem;
--spacing-10: 2.5rem;
--spacing-11: 2.75rem;
--spacing-12: 3rem;
--spacing-14: 3.5rem;
--spacing-16: 4rem;
--spacing-20: 5rem;
--spacing-24: 6rem;
--spacing-28: 7rem;
--spacing-32: 8rem;
--spacing-36: 9rem;
--spacing-40: 10rem;
--spacing-44: 11rem;
--spacing-48: 12rem;
--spacing-52: 13rem;
--spacing-56: 14rem;
--spacing-60: 15rem;
--spacing-64: 16rem;
--spacing-72: 18rem;
--spacing-80: 20rem;
--spacing-96: 24rem;
--spacing-0\.5: 0.125rem;
--spacing-1\.5: 0.375rem;
--spacing-2\.5: 0.625rem;
--spacing-3\.5: 0.875rem;
--sizes-0: 0rem;
--sizes-1: 0.25rem;
--sizes-2: 0.5rem;
--sizes-3: 0.75rem;
--sizes-4: 1rem;
--sizes-5: 1.25rem;
--sizes-6: 1.5rem;
--sizes-7: 1.75rem;
--sizes-8: 2rem;
--sizes-9: 2.25rem;
--sizes-10: 2.5rem;
--sizes-11: 2.75rem;
--sizes-12: 3rem;
--sizes-14: 3.5rem;
--sizes-16: 4rem;
--sizes-20: 5rem;
--sizes-24: 6rem;
--sizes-28: 7rem;
--sizes-32: 8rem;
--sizes-36: 9rem;
--sizes-40: 10rem;
--sizes-44: 11rem;
--sizes-48: 12rem;
--sizes-52: 13rem;
--sizes-56: 14rem;
--sizes-60: 15rem;
--sizes-64: 16rem;
--sizes-72: 18rem;
--sizes-80: 20rem;
--sizes-96: 24rem;
--sizes-0\.5: 0.125rem;
--sizes-1\.5: 0.375rem;
--sizes-2\.5: 0.625rem;
--sizes-3\.5: 0.875rem;
--sizes-xs: 20rem;
--sizes-sm: 24rem;
--sizes-md: 28rem;
--sizes-lg: 32rem;
--sizes-xl: 36rem;
--sizes-2xl: 42rem;
--sizes-3xl: 48rem;
--sizes-4xl: 56rem;
--sizes-5xl: 64rem;
--sizes-6xl: 72rem;
--sizes-7xl: 80rem;
--sizes-8xl: 90rem;
--sizes-prose: 65ch;
--sizes-full: 100%;
--sizes-min: min-content;
--sizes-max: max-content;
--sizes-fit: fit-content;
--sizes-breakpoint-sm: 640px;
--sizes-breakpoint-md: 768px;
--sizes-breakpoint-lg: 1024px;
--sizes-breakpoint-xl: 1280px;
--sizes-breakpoint-2xl: 1536px;
--animations-spin: spin 1s linear infinite;
--animations-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
--animations-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
--animations-bounce: bounce 1s infinite;
--breakpoints-sm: 640px;
--breakpoints-md: 768px;
--breakpoints-lg: 1024px;
--breakpoints-xl: 1280px;
--breakpoints-2xl: 1536px
}
}

9
src/styled-system/tokens/index.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* eslint-disable */
import type { Token } from './tokens'
export declare const token: {
(path: Token, fallback?: string): string
var: (path: Token, fallback?: string) => string
}
export * from './tokens'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
@layer tokens {
@keyframes spin {
to {
transform: rotate(360deg)
}
}
@keyframes ping {
75%, 100% {
transform: scale(2);
opacity: 0
}
}
@keyframes pulse {
50% {
opacity: .5
}
}
@keyframes bounce {
0%, 100% {
transform: translateY(-25%);
animation-timing-function: cubic-bezier(0.8,0,1,1)
}
50% {
transform: none;
animation-timing-function: cubic-bezier(0,0,0.2,1)
}
}
}

60
src/styled-system/tokens/tokens.d.ts vendored Normal file

File diff suppressed because one or more lines are too long

111
src/styled-system/types/composition.d.ts vendored Normal file
View File

@ -0,0 +1,111 @@
/* eslint-disable */
import type { CompositionStyleObject } from './system-types'
type Recursive<T> = {
[key: string]: Recursive<T> | T
}
export type Token<Value = any> = {
value: Value
description?: string
}
/* -----------------------------------------------------------------------------
* Text styles
* -----------------------------------------------------------------------------*/
type TextStyleProperty =
| 'fontSize'
| 'fontSizeAdjust'
| 'fontVariationSettings'
| 'fontVariantPosition'
| 'fontVariantCaps'
| 'fontVariantNumeric'
| 'fontVariantAlternates'
| 'fontVariantLigatures'
| 'fontFamily'
| 'fontWeight'
| 'fontSynthesis'
| 'fontStyle'
| 'fontVariant'
| 'lineHeight'
| 'letterSpacing'
| 'textDecoration'
| 'textTransform'
| 'textIndent'
| 'textDecorationColor'
| 'textDecorationLine'
| 'textDecorationStyle'
| 'textEmphasisColor'
| 'textEmphasisPosition'
| 'textEmphasisStyle'
| 'hyphenateCharacter'
| 'textOrientation'
| 'textOverflow'
| 'textRendering'
export type TextStyle = CompositionStyleObject<TextStyleProperty>
export type TextStyles = Recursive<Token<TextStyle>>
/* -----------------------------------------------------------------------------
* Layer styles
* -----------------------------------------------------------------------------*/
type Placement =
| 'Top'
| 'Right'
| 'Bottom'
| 'Left'
| 'Inline'
| 'Block'
| 'InlineStart'
| 'InlineEnd'
| 'BlockStart'
| 'BlockEnd'
type Radius =
| `Top${'Right' | 'Left'}`
| `Bottom${'Right' | 'Left'}`
| `Start${'Start' | 'End'}`
| `End${'Start' | 'End'}`
type LayerStyleProperty =
| 'background'
| 'backgroundColor'
| 'backgroundImage'
| 'borderRadius'
| 'border'
| 'borderWidth'
| 'borderColor'
| 'borderStyle'
| 'boxShadow'
| 'filter'
| 'backdropFilter'
| 'transform'
| 'color'
| 'opacity'
| 'backgroundBlendMode'
| 'backgroundAttachment'
| 'backgroundClip'
| 'backgroundOrigin'
| 'backgroundPosition'
| 'backgroundRepeat'
| 'backgroundSize'
| `border${Placement}`
| `border${Placement}Width`
| 'borderRadius'
| `border${Radius}Radius`
| `border${Placement}Color`
| `border${Placement}Style`
| 'padding'
| `padding${Placement}`
export type LayerStyle = CompositionStyleObject<LayerStyleProperty>
export type LayerStyles = Recursive<Token<LayerStyle>>
export type CompositionStyles = {
textStyles: TextStyles
layerStyles: LayerStyles
}

136
src/styled-system/types/conditions.d.ts vendored Normal file
View File

@ -0,0 +1,136 @@
/* eslint-disable */
import type { AnySelector, Selectors } from './selectors'
export type Conditions = {
"_hover": string
"_focus": string
"_focusWithin": string
"_focusVisible": string
"_disabled": string
"_active": string
"_visited": string
"_target": string
"_readOnly": string
"_readWrite": string
"_empty": string
"_checked": string
"_enabled": string
"_expanded": string
"_highlighted": string
"_before": string
"_after": string
"_firstLetter": string
"_firstLine": string
"_marker": string
"_selection": string
"_file": string
"_backdrop": string
"_first": string
"_last": string
"_only": string
"_even": string
"_odd": string
"_firstOfType": string
"_lastOfType": string
"_onlyOfType": string
"_peerFocus": string
"_peerHover": string
"_peerActive": string
"_peerFocusWithin": string
"_peerFocusVisible": string
"_peerDisabled": string
"_peerChecked": string
"_peerInvalid": string
"_peerExpanded": string
"_peerPlaceholderShown": string
"_groupFocus": string
"_groupHover": string
"_groupActive": string
"_groupFocusWithin": string
"_groupFocusVisible": string
"_groupDisabled": string
"_groupChecked": string
"_groupExpanded": string
"_groupInvalid": string
"_indeterminate": string
"_required": string
"_valid": string
"_invalid": string
"_autofill": string
"_inRange": string
"_outOfRange": string
"_placeholder": string
"_placeholderShown": string
"_pressed": string
"_selected": string
"_default": string
"_optional": string
"_open": string
"_fullscreen": string
"_loading": string
"_currentPage": string
"_currentStep": string
"_motionReduce": string
"_motionSafe": string
"_print": string
"_landscape": string
"_portrait": string
"_dark": string
"_light": string
"_osDark": string
"_osLight": string
"_highContrast": string
"_lessContrast": string
"_moreContrast": string
"_ltr": string
"_rtl": string
"_scrollbar": string
"_scrollbarThumb": string
"_scrollbarTrack": string
"_horizontal": string
"_vertical": string
"sm": string
"smOnly": string
"smDown": string
"md": string
"mdOnly": string
"mdDown": string
"lg": string
"lgOnly": string
"lgDown": string
"xl": string
"xlOnly": string
"xlDown": string
"2xl": string
"2xlOnly": string
"smToMd": string
"smToLg": string
"smToXl": string
"smTo2xl": string
"mdToLg": string
"mdToXl": string
"mdTo2xl": string
"lgToXl": string
"lgTo2xl": string
"xlTo2xl": string
"base": string
}
export type Condition = keyof Conditions
export type Conditional<V> =
| V
| Array<V | null>
| {
[K in keyof Conditions]?: Conditional<V>
}
export type ConditionalValue<T> = Conditional<T>
export type Nested<P> = P & {
[K in Selectors]?: Nested<P>
} & {
[K in AnySelector]?: Nested<P>
} & {
[K in keyof Conditions]?: Nested<P>
}

20749
src/styled-system/types/csstype.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

18
src/styled-system/types/global.d.ts vendored Normal file
View File

@ -0,0 +1,18 @@
/* eslint-disable */
import type { TextStyles, LayerStyles } from '@pandacss/dev'
import type { RecipeVariantRecord, RecipeConfig, SlotRecipeVariantRecord, SlotRecipeConfig } from './recipe'
import type { Parts } from './parts'
import type { PatternConfig, PatternProperties } from './pattern'
import type { GlobalStyleObject, SystemStyleObject } from './system-types'
import type { CompositionStyles } from './composition'
declare module '@pandacss/dev' {
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): RecipeConfig
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): SlotRecipeConfig
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
export function defineTextStyles(definition: CompositionStyles['textStyles']): TextStyles
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): LayerStyles
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): PatternConfig
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
}

2
src/styled-system/types/helpers.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/* eslint-disable */
export type Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never

4
src/styled-system/types/index.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/* eslint-disable */
import './global'
export type { ConditionalValue } from './conditions'
export type { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'

6
src/styled-system/types/parts.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
/* eslint-disable */
export type Part = {
selector: string
}
export type Parts = Record<string, Part>

61
src/styled-system/types/pattern.d.ts vendored Normal file
View File

@ -0,0 +1,61 @@
/* eslint-disable */
import type { CssProperty, SystemStyleObject } from './system-types'
import type { TokenCategory } from '../tokens'
type Primitive = string | number | boolean | null | undefined
type LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)
export type PatternProperty =
| { type: 'property'; value: CssProperty }
| { type: 'enum'; value: string[] }
| { type: 'token'; value: TokenCategory; property?: CssProperty }
| { type: 'string' | 'boolean' | 'number' }
export type PatternHelpers = {
map: (value: any, fn: (value: string) => string | undefined) => any
}
export type PatternProperties = Record<string, PatternProperty>
type Props<T> = Record<LiteralUnion<keyof T>, any>
export type PatternConfig<T extends PatternProperties = PatternProperties> = {
/**
* The description of the pattern. This will be used in the JSDoc comment.
*/
description?: string
/**
* The JSX element rendered by the pattern
* @default 'div'
*/
jsxElement?: string
/**
* The properties of the pattern.
*/
properties?: T
/**
* The css object this pattern will generate.
*/
transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject
/**
* The jsx element name this pattern will generate.
*/
jsxName?: string
/**
* The jsx elements to track for this pattern. Can be string or Regexp.
*
* @default capitalize(pattern.name)
* @example ['Button', 'Link', /Button$/]
*/
jsx?: Array<string | RegExp>
/**
* Whether to only generate types for the specified properties.
* This will disallow css properties
*/
strict?: boolean
/**
* @experimental
* Disallow certain css properties for this pattern
*/
blocklist?: LiteralUnion<CssProperty>[]
}

309
src/styled-system/types/prop-type.d.ts vendored Normal file
View File

@ -0,0 +1,309 @@
/* eslint-disable */
import type { ConditionalValue } from './conditions';
import type { CssProperties } from './system-types'
import type { Tokens } from '../tokens'
type PropertyValueTypes = {
aspectRatio: "auto" | "square" | "landscape" | "portrait" | "wide" | "ultrawide" | "golden";
zIndex: Tokens["zIndex"];
top: Tokens["spacing"];
left: Tokens["spacing"];
insetInline: Tokens["spacing"];
insetBlock: Tokens["spacing"];
inset: "auto" | Tokens["spacing"];
insetBlockEnd: Tokens["spacing"];
insetBlockStart: Tokens["spacing"];
insetInlineEnd: Tokens["spacing"];
insetInlineStart: Tokens["spacing"];
right: Tokens["spacing"];
bottom: Tokens["spacing"];
insetX: Tokens["spacing"] | CssProperties["insetInline"];
insetY: Tokens["spacing"] | CssProperties["insetBlock"];
float: "left" | "right" | "start" | "end";
hideFrom: Tokens["breakpoints"];
hideBelow: Tokens["breakpoints"];
flexBasis: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full";
flex: "1" | "auto" | "initial" | "none";
gridTemplateColumns: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
gridTemplateRows: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
gridColumn: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "full";
gridRow: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "full";
gridAutoColumns: "min" | "max" | "fr";
gridAutoRows: "min" | "max" | "fr";
gap: Tokens["spacing"];
gridGap: Tokens["spacing"];
gridRowGap: Tokens["spacing"];
gridColumnGap: Tokens["spacing"];
rowGap: Tokens["spacing"];
columnGap: Tokens["spacing"];
padding: Tokens["spacing"];
paddingLeft: Tokens["spacing"];
paddingRight: Tokens["spacing"];
paddingTop: Tokens["spacing"];
paddingBottom: Tokens["spacing"];
paddingBlock: Tokens["spacing"];
paddingBlockEnd: Tokens["spacing"];
paddingBlockStart: Tokens["spacing"];
paddingInline: Tokens["spacing"];
paddingInlineEnd: Tokens["spacing"];
paddingInlineStart: Tokens["spacing"];
marginLeft: "auto" | Tokens["spacing"];
marginRight: "auto" | Tokens["spacing"];
marginTop: "auto" | Tokens["spacing"];
marginBottom: "auto" | Tokens["spacing"];
margin: "auto" | Tokens["spacing"];
marginBlock: "auto" | Tokens["spacing"];
marginBlockEnd: "auto" | Tokens["spacing"];
marginBlockStart: "auto" | Tokens["spacing"];
marginInline: "auto" | Tokens["spacing"];
marginInlineEnd: "auto" | Tokens["spacing"];
marginInlineStart: "auto" | Tokens["spacing"];
outlineColor: Tokens["colors"];
outline: Tokens["borders"];
outlineOffset: Tokens["spacing"];
divideX: string;
divideY: string;
divideColor: Tokens["colors"];
divideStyle: CssProperties["borderStyle"];
width: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
inlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
minWidth: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
minInlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
maxWidth: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
maxInlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
height: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
blockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
minHeight: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
minBlockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
maxHeight: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
maxBlockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
color: Tokens["colors"];
fontFamily: Tokens["fonts"];
fontSize: Tokens["fontSizes"];
fontWeight: Tokens["fontWeights"];
fontSmoothing: "antialiased" | "subpixel-antialiased";
letterSpacing: Tokens["letterSpacings"];
lineHeight: Tokens["lineHeights"];
textDecorationColor: Tokens["colors"];
textEmphasisColor: Tokens["colors"];
textIndent: Tokens["spacing"];
textShadow: Tokens["shadows"];
textWrap: "wrap" | "balance" | "nowrap";
truncate: boolean;
listStyleImage: Tokens["assets"];
background: Tokens["colors"];
backgroundColor: Tokens["colors"];
backgroundImage: Tokens["assets"];
backgroundGradient: Tokens["gradients"] | "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
textGradient: Tokens["gradients"] | "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
gradientFrom: Tokens["colors"];
gradientTo: Tokens["colors"];
gradientVia: Tokens["colors"];
borderRadius: Tokens["radii"];
borderTopLeftRadius: Tokens["radii"];
borderTopRightRadius: Tokens["radii"];
borderBottomRightRadius: Tokens["radii"];
borderBottomLeftRadius: Tokens["radii"];
borderTopRadius: Tokens["radii"] | CssProperties["borderRadius"];
borderRightRadius: Tokens["radii"] | CssProperties["borderRadius"];
borderBottomRadius: Tokens["radii"] | CssProperties["borderRadius"];
borderLeftRadius: Tokens["radii"] | CssProperties["borderRadius"];
borderStartStartRadius: Tokens["radii"];
borderStartEndRadius: Tokens["radii"];
borderStartRadius: Tokens["radii"] | CssProperties["borderRadius"];
borderEndStartRadius: Tokens["radii"];
borderEndEndRadius: Tokens["radii"];
borderEndRadius: Tokens["radii"] | CssProperties["borderRadius"];
border: Tokens["borders"];
borderColor: Tokens["colors"];
borderInline: Tokens["borders"];
borderInlineWidth: Tokens["borderWidths"];
borderInlineColor: Tokens["colors"];
borderBlock: Tokens["borders"];
borderBlockWidth: Tokens["borderWidths"];
borderBlockColor: Tokens["colors"];
borderLeft: Tokens["borders"];
borderLeftColor: Tokens["colors"];
borderInlineStart: Tokens["borders"];
borderInlineStartWidth: Tokens["borderWidths"];
borderInlineStartColor: Tokens["colors"];
borderRight: Tokens["borders"];
borderRightColor: Tokens["colors"];
borderInlineEnd: Tokens["borders"];
borderInlineEndWidth: Tokens["borderWidths"];
borderInlineEndColor: Tokens["colors"];
borderTop: Tokens["borders"];
borderTopColor: Tokens["colors"];
borderBottom: Tokens["borders"];
borderBottomColor: Tokens["colors"];
borderBlockEnd: Tokens["borders"];
borderBlockEndColor: Tokens["colors"];
borderBlockStart: Tokens["borders"];
borderBlockStartColor: Tokens["colors"];
opacity: Tokens["opacity"];
boxShadow: Tokens["shadows"];
boxShadowColor: Tokens["colors"];
filter: "auto";
dropShadow: Tokens["dropShadows"];
blur: Tokens["blurs"];
backdropFilter: "auto";
backdropBlur: Tokens["blurs"];
borderSpacing: Tokens["spacing"];
borderSpacingX: Tokens["spacing"];
borderSpacingY: Tokens["spacing"];
transitionTimingFunction: Tokens["easings"];
transitionDelay: Tokens["durations"];
transitionDuration: Tokens["durations"];
transition: "all" | "common" | "background" | "colors" | "opacity" | "shadow" | "transform";
animation: Tokens["animations"];
animationName: Tokens["animationName"];
animationDelay: Tokens["durations"];
scale: "auto" | CssProperties["scale"];
translate: "auto" | CssProperties["translate"];
translateX: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
translateY: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
accentColor: Tokens["colors"];
caretColor: Tokens["colors"];
scrollbar: "visible" | "hidden";
scrollMargin: Tokens["spacing"];
scrollMarginX: Tokens["spacing"] | CssProperties["scrollMarginInline"];
scrollMarginY: Tokens["spacing"] | CssProperties["scrollMarginBlock"];
scrollMarginLeft: Tokens["spacing"];
scrollMarginRight: Tokens["spacing"];
scrollMarginTop: Tokens["spacing"];
scrollMarginBottom: Tokens["spacing"];
scrollMarginBlock: Tokens["spacing"];
scrollMarginBlockEnd: Tokens["spacing"];
scrollMarginBlockStart: Tokens["spacing"];
scrollMarginInline: Tokens["spacing"];
scrollMarginInlineEnd: Tokens["spacing"];
scrollMarginInlineStart: Tokens["spacing"];
scrollPadding: Tokens["spacing"];
scrollPaddingBlock: Tokens["spacing"];
scrollPaddingBlockStart: Tokens["spacing"];
scrollPaddingBlockEnd: Tokens["spacing"];
scrollPaddingInline: Tokens["spacing"];
scrollPaddingInlineEnd: Tokens["spacing"];
scrollPaddingInlineStart: Tokens["spacing"];
scrollPaddingX: Tokens["spacing"] | CssProperties["scrollPaddingInline"];
scrollPaddingY: Tokens["spacing"] | CssProperties["scrollPaddingBlock"];
scrollPaddingLeft: Tokens["spacing"];
scrollPaddingRight: Tokens["spacing"];
scrollPaddingTop: Tokens["spacing"];
scrollPaddingBottom: Tokens["spacing"];
scrollSnapType: "none" | "x" | "y" | "both";
scrollSnapStrictness: "mandatory" | "proximity";
scrollSnapMargin: Tokens["spacing"];
scrollSnapMarginTop: Tokens["spacing"];
scrollSnapMarginBottom: Tokens["spacing"];
scrollSnapMarginLeft: Tokens["spacing"];
scrollSnapMarginRight: Tokens["spacing"];
fill: Tokens["colors"];
stroke: Tokens["colors"];
srOnly: boolean;
debug: boolean;
colorPalette: "rose" | "pink" | "fuchsia" | "purple" | "violet" | "indigo" | "blue" | "sky" | "cyan" | "teal" | "emerald" | "green" | "lime" | "yellow" | "amber" | "orange" | "red" | "neutral" | "stone" | "zinc" | "gray" | "slate";
textStyle: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
}
type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T] | CssValue<T> : CssValue<T>
export type PropertyTypes = PropertyValueTypes & {
pos: Shorthand<"position">;
insetEnd: Shorthand<"insetInlineEnd">;
end: Shorthand<"insetInlineEnd">;
insetStart: Shorthand<"insetInlineStart">;
start: Shorthand<"insetInlineStart">;
flexDir: Shorthand<"flexDirection">;
p: Shorthand<"padding">;
pl: Shorthand<"paddingLeft">;
pr: Shorthand<"paddingRight">;
pt: Shorthand<"paddingTop">;
pb: Shorthand<"paddingBottom">;
py: Shorthand<"paddingBlock">;
paddingY: Shorthand<"paddingBlock">;
paddingX: Shorthand<"paddingInline">;
px: Shorthand<"paddingInline">;
pe: Shorthand<"paddingInlineEnd">;
paddingEnd: Shorthand<"paddingInlineEnd">;
ps: Shorthand<"paddingInlineStart">;
paddingStart: Shorthand<"paddingInlineStart">;
ml: Shorthand<"marginLeft">;
mr: Shorthand<"marginRight">;
mt: Shorthand<"marginTop">;
mb: Shorthand<"marginBottom">;
m: Shorthand<"margin">;
my: Shorthand<"marginBlock">;
marginY: Shorthand<"marginBlock">;
mx: Shorthand<"marginInline">;
marginX: Shorthand<"marginInline">;
me: Shorthand<"marginInlineEnd">;
marginEnd: Shorthand<"marginInlineEnd">;
ms: Shorthand<"marginInlineStart">;
marginStart: Shorthand<"marginInlineStart">;
ringWidth: Shorthand<"outlineWidth">;
ringColor: Shorthand<"outlineColor">;
ring: Shorthand<"outline">;
ringOffset: Shorthand<"outlineOffset">;
w: Shorthand<"width">;
minW: Shorthand<"minWidth">;
maxW: Shorthand<"maxWidth">;
h: Shorthand<"height">;
minH: Shorthand<"minHeight">;
maxH: Shorthand<"maxHeight">;
bgPosition: Shorthand<"backgroundPosition">;
bgPositionX: Shorthand<"backgroundPositionX">;
bgPositionY: Shorthand<"backgroundPositionY">;
bgAttachment: Shorthand<"backgroundAttachment">;
bgClip: Shorthand<"backgroundClip">;
bg: Shorthand<"background">;
bgColor: Shorthand<"backgroundColor">;
bgOrigin: Shorthand<"backgroundOrigin">;
bgImage: Shorthand<"backgroundImage">;
bgRepeat: Shorthand<"backgroundRepeat">;
bgBlendMode: Shorthand<"backgroundBlendMode">;
bgSize: Shorthand<"backgroundSize">;
bgGradient: Shorthand<"backgroundGradient">;
rounded: Shorthand<"borderRadius">;
roundedTopLeft: Shorthand<"borderTopLeftRadius">;
roundedTopRight: Shorthand<"borderTopRightRadius">;
roundedBottomRight: Shorthand<"borderBottomRightRadius">;
roundedBottomLeft: Shorthand<"borderBottomLeftRadius">;
roundedTop: Shorthand<"borderTopRadius">;
roundedRight: Shorthand<"borderRightRadius">;
roundedBottom: Shorthand<"borderBottomRadius">;
roundedLeft: Shorthand<"borderLeftRadius">;
roundedStartStart: Shorthand<"borderStartStartRadius">;
roundedStartEnd: Shorthand<"borderStartEndRadius">;
roundedStart: Shorthand<"borderStartRadius">;
roundedEndStart: Shorthand<"borderEndStartRadius">;
roundedEndEnd: Shorthand<"borderEndEndRadius">;
roundedEnd: Shorthand<"borderEndRadius">;
borderX: Shorthand<"borderInline">;
borderXWidth: Shorthand<"borderInlineWidth">;
borderXColor: Shorthand<"borderInlineColor">;
borderY: Shorthand<"borderBlock">;
borderYWidth: Shorthand<"borderBlockWidth">;
borderYColor: Shorthand<"borderBlockColor">;
borderStart: Shorthand<"borderInlineStart">;
borderStartWidth: Shorthand<"borderInlineStartWidth">;
borderStartColor: Shorthand<"borderInlineStartColor">;
borderEnd: Shorthand<"borderInlineEnd">;
borderEndWidth: Shorthand<"borderInlineEndWidth">;
borderEndColor: Shorthand<"borderInlineEndColor">;
shadow: Shorthand<"boxShadow">;
shadowColor: Shorthand<"boxShadowColor">;
x: Shorthand<"translateX">;
y: Shorthand<"translateY">;
}
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
? ConditionalValue<PropertyTypes[T] | CssValue<T> | (string & {})>
: T extends keyof CssProperties
? ConditionalValue<CssProperties[T] | (string & {})>
: ConditionalValue<string | number>

142
src/styled-system/types/recipe.d.ts vendored Normal file
View File

@ -0,0 +1,142 @@
/* eslint-disable */
import type { SystemStyleObject, DistributiveOmit } from './system-types'
type Pretty<T> = { [K in keyof T]: T[K] } & {}
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
export type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>
export type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T
? {}
: {
[K in keyof T]?: StringToBoolean<keyof T[K]>
}
export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
export type RecipeVariantProps<
T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
> = Pretty<Parameters<T>[0]>
type RecipeVariantMap<T extends RecipeVariantRecord> = {
[K in keyof T]: Array<keyof T[K]>
}
/* -----------------------------------------------------------------------------
* Recipe / Standard
* -----------------------------------------------------------------------------*/
export type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {
__type: RecipeSelection<T>
variantKeys: (keyof T)[]
variantMap: RecipeVariantMap<T>
raw: (props?: RecipeSelection<T>) => SystemStyleObject
config: RecipeConfig<T>
splitVariantProps<Props extends RecipeSelection<T>>(
props: Props,
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
}
export type RecipeCompoundSelection<T extends RecipeVariantRecord> = {
[K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>
}
export type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
css: SystemStyleObject
}
export type RecipeDefinition<T extends RecipeVariantRecord> = {
/**
* The base styles of the recipe.
*/
base?: SystemStyleObject
/**
* The multi-variant styles of the recipe.
*/
variants?: T | RecipeVariantRecord
/**
* The default variants of the recipe.
*/
defaultVariants?: RecipeSelection<T>
/**
* The styles to apply when a combination of variants is selected.
*/
compoundVariants?: Array<RecipeCompoundVariant<T>>
}
export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
type RecipeConfigMeta = {
/**
* The name of the recipe.
*/
className: string
/**
* The description of the recipe. This will be used in the JSDoc comment.
*/
description?: string
/**
* The jsx elements to track for this recipe. Can be string or Regexp.
*
* @default capitalize(recipe.name)
* @example ['Button', 'Link', /Button$/]
*/
jsx?: Array<string | RegExp>
}
export type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & RecipeConfigMeta
/* -----------------------------------------------------------------------------
* Recipe / Slot
* -----------------------------------------------------------------------------*/
type SlotRecord<S extends string, T> = Partial<Record<S, T>>
export type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>
export type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (
props?: RecipeSelection<T>,
) => SlotRecord<S, string>
export type SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>> = SlotRecipeVariantFn<S, T> & {
variantKeys: (keyof T)[]
variantMap: RecipeVariantMap<T>
splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]
}
export type SlotRecipeCompoundVariant<S extends string, T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {
css: SlotRecord<S, SystemStyleObject>
}
export type SlotRecipeDefinition<S extends string, T extends SlotRecipeVariantRecord<S>> = {
/**
* The parts/slots of the recipe.
*/
slots: S[] | Readonly<S[]>
/**
* The base styles of the recipe.
*/
base?: SlotRecord<S, SystemStyleObject>
/**
* The multi-variant styles of the recipe.
*/
variants?: T | SlotRecipeVariantRecord<S>
/**
* The default variants of the recipe.
*/
defaultVariants?: RecipeSelection<T>
/**
* The styles to apply when a combination of variants is selected.
*/
compoundVariants?: Array<SlotRecipeCompoundVariant<S, T>>
}
export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(
config: SlotRecipeDefinition<S, T>,
) => SlotRecipeRuntimeFn<S, T>
export type SlotRecipeConfig<
S extends string = string,
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
> = SlotRecipeDefinition<S, T> & RecipeConfigMeta

59
src/styled-system/types/selectors.d.ts vendored Normal file
View File

@ -0,0 +1,59 @@
/* eslint-disable */
import type { Pseudos } from './csstype'
type AriaAttributes =
| '[aria-disabled]'
| '[aria-hidden]'
| '[aria-invalid]'
| '[aria-readonly]'
| '[aria-required]'
| '[aria-selected]'
| '[aria-checked]'
| '[aria-expanded]'
| '[aria-pressed]'
| `[aria-current=${'page' | 'step' | 'location' | 'date' | 'time'}]`
| '[aria-invalid]'
| `[aria-sort=${'ascending' | 'descending'}]`
type DataAttributes =
| '[data-selected]'
| '[data-highlighted]'
| '[data-hover]'
| '[data-active]'
| '[data-checked]'
| '[data-disabled]'
| '[data-readonly]'
| '[data-focus]'
| '[data-focus-visible]'
| '[data-focus-visible-added]'
| '[data-invalid]'
| '[data-pressed]'
| '[data-expanded]'
| '[data-grabbed]'
| '[data-dragged]'
| '[data-orientation=horizontal]'
| '[data-orientation=vertical]'
| '[data-in-range]'
| '[data-out-of-range]'
| '[data-placeholder-shown]'
| `[data-part=${string}]`
| `[data-attr=${string}]`
| `[data-placement=${string}]`
| `[data-theme=${string}]`
| `[data-size=${string}]`
| `[data-state=${string}]`
| '[data-empty]'
| '[data-loading]'
| '[data-loaded]'
| '[data-enter]'
| '[data-entering]'
| '[data-exited]'
| '[data-exiting]'
type AttributeSelector = `&${Pseudos | DataAttributes | AriaAttributes}`
type ParentSelector = `${DataAttributes | AriaAttributes} &`
type AtRuleType = 'media' | 'layer' | 'container' | 'supports' | 'page'
export type AnySelector = `${string}&` | `&${string}` | `@${AtRuleType}${string}`
export type Selectors = AttributeSelector | ParentSelector

653
src/styled-system/types/style-props.d.ts vendored Normal file
View File

@ -0,0 +1,653 @@
/* eslint-disable */
import type { ConditionalValue } from './conditions'
import type { PropertyValue } from './prop-type'
import type { Token } from '../tokens'
export type CssVarProperties = {
[key in `--${string}`]?: ConditionalValue<Token | (string & {}) | (number & {})>
}
export type SystemProperties = {
WebkitAppearance?: PropertyValue<'WebkitAppearance'>
WebkitBorderBefore?: PropertyValue<'WebkitBorderBefore'>
WebkitBorderBeforeColor?: PropertyValue<'WebkitBorderBeforeColor'>
WebkitBorderBeforeStyle?: PropertyValue<'WebkitBorderBeforeStyle'>
WebkitBorderBeforeWidth?: PropertyValue<'WebkitBorderBeforeWidth'>
WebkitBoxReflect?: PropertyValue<'WebkitBoxReflect'>
WebkitLineClamp?: PropertyValue<'WebkitLineClamp'>
WebkitMask?: PropertyValue<'WebkitMask'>
WebkitMaskAttachment?: PropertyValue<'WebkitMaskAttachment'>
WebkitMaskClip?: PropertyValue<'WebkitMaskClip'>
WebkitMaskComposite?: PropertyValue<'WebkitMaskComposite'>
WebkitMaskImage?: PropertyValue<'WebkitMaskImage'>
WebkitMaskOrigin?: PropertyValue<'WebkitMaskOrigin'>
WebkitMaskPosition?: PropertyValue<'WebkitMaskPosition'>
WebkitMaskPositionX?: PropertyValue<'WebkitMaskPositionX'>
WebkitMaskPositionY?: PropertyValue<'WebkitMaskPositionY'>
WebkitMaskRepeat?: PropertyValue<'WebkitMaskRepeat'>
WebkitMaskRepeatX?: PropertyValue<'WebkitMaskRepeatX'>
WebkitMaskRepeatY?: PropertyValue<'WebkitMaskRepeatY'>
WebkitMaskSize?: PropertyValue<'WebkitMaskSize'>
WebkitOverflowScrolling?: PropertyValue<'WebkitOverflowScrolling'>
WebkitTapHighlightColor?: PropertyValue<'WebkitTapHighlightColor'>
WebkitTextFillColor?: PropertyValue<'WebkitTextFillColor'>
WebkitTextStroke?: PropertyValue<'WebkitTextStroke'>
WebkitTextStrokeColor?: PropertyValue<'WebkitTextStrokeColor'>
WebkitTextStrokeWidth?: PropertyValue<'WebkitTextStrokeWidth'>
WebkitTouchCallout?: PropertyValue<'WebkitTouchCallout'>
WebkitUserModify?: PropertyValue<'WebkitUserModify'>
accentColor?: PropertyValue<'accentColor'>
alignContent?: PropertyValue<'alignContent'>
alignItems?: PropertyValue<'alignItems'>
alignSelf?: PropertyValue<'alignSelf'>
alignTracks?: PropertyValue<'alignTracks'>
all?: PropertyValue<'all'>
animation?: PropertyValue<'animation'>
animationComposition?: PropertyValue<'animationComposition'>
animationDelay?: PropertyValue<'animationDelay'>
animationDirection?: PropertyValue<'animationDirection'>
animationDuration?: PropertyValue<'animationDuration'>
animationFillMode?: PropertyValue<'animationFillMode'>
animationIterationCount?: PropertyValue<'animationIterationCount'>
animationName?: PropertyValue<'animationName'>
animationPlayState?: PropertyValue<'animationPlayState'>
animationTimingFunction?: PropertyValue<'animationTimingFunction'>
animationTimeline?: PropertyValue<'animationTimeline'>
appearance?: PropertyValue<'appearance'>
aspectRatio?: PropertyValue<'aspectRatio'>
azimuth?: PropertyValue<'azimuth'>
backdropFilter?: PropertyValue<'backdropFilter'>
backfaceVisibility?: PropertyValue<'backfaceVisibility'>
background?: PropertyValue<'background'>
backgroundAttachment?: PropertyValue<'backgroundAttachment'>
backgroundBlendMode?: PropertyValue<'backgroundBlendMode'>
backgroundClip?: PropertyValue<'backgroundClip'>
backgroundColor?: PropertyValue<'backgroundColor'>
backgroundImage?: PropertyValue<'backgroundImage'>
backgroundOrigin?: PropertyValue<'backgroundOrigin'>
backgroundPosition?: PropertyValue<'backgroundPosition'>
backgroundPositionX?: PropertyValue<'backgroundPositionX'>
backgroundPositionY?: PropertyValue<'backgroundPositionY'>
backgroundRepeat?: PropertyValue<'backgroundRepeat'>
backgroundSize?: PropertyValue<'backgroundSize'>
blockOverflow?: PropertyValue<'blockOverflow'>
blockSize?: PropertyValue<'blockSize'>
border?: PropertyValue<'border'>
borderBlock?: PropertyValue<'borderBlock'>
borderBlockColor?: PropertyValue<'borderBlockColor'>
borderBlockStyle?: PropertyValue<'borderBlockStyle'>
borderBlockWidth?: PropertyValue<'borderBlockWidth'>
borderBlockEnd?: PropertyValue<'borderBlockEnd'>
borderBlockEndColor?: PropertyValue<'borderBlockEndColor'>
borderBlockEndStyle?: PropertyValue<'borderBlockEndStyle'>
borderBlockEndWidth?: PropertyValue<'borderBlockEndWidth'>
borderBlockStart?: PropertyValue<'borderBlockStart'>
borderBlockStartColor?: PropertyValue<'borderBlockStartColor'>
borderBlockStartStyle?: PropertyValue<'borderBlockStartStyle'>
borderBlockStartWidth?: PropertyValue<'borderBlockStartWidth'>
borderBottom?: PropertyValue<'borderBottom'>
borderBottomColor?: PropertyValue<'borderBottomColor'>
borderBottomLeftRadius?: PropertyValue<'borderBottomLeftRadius'>
borderBottomRightRadius?: PropertyValue<'borderBottomRightRadius'>
borderBottomStyle?: PropertyValue<'borderBottomStyle'>
borderBottomWidth?: PropertyValue<'borderBottomWidth'>
borderCollapse?: PropertyValue<'borderCollapse'>
borderColor?: PropertyValue<'borderColor'>
borderEndEndRadius?: PropertyValue<'borderEndEndRadius'>
borderEndStartRadius?: PropertyValue<'borderEndStartRadius'>
borderImage?: PropertyValue<'borderImage'>
borderImageOutset?: PropertyValue<'borderImageOutset'>
borderImageRepeat?: PropertyValue<'borderImageRepeat'>
borderImageSlice?: PropertyValue<'borderImageSlice'>
borderImageSource?: PropertyValue<'borderImageSource'>
borderImageWidth?: PropertyValue<'borderImageWidth'>
borderInline?: PropertyValue<'borderInline'>
borderInlineEnd?: PropertyValue<'borderInlineEnd'>
borderInlineColor?: PropertyValue<'borderInlineColor'>
borderInlineStyle?: PropertyValue<'borderInlineStyle'>
borderInlineWidth?: PropertyValue<'borderInlineWidth'>
borderInlineEndColor?: PropertyValue<'borderInlineEndColor'>
borderInlineEndStyle?: PropertyValue<'borderInlineEndStyle'>
borderInlineEndWidth?: PropertyValue<'borderInlineEndWidth'>
borderInlineStart?: PropertyValue<'borderInlineStart'>
borderInlineStartColor?: PropertyValue<'borderInlineStartColor'>
borderInlineStartStyle?: PropertyValue<'borderInlineStartStyle'>
borderInlineStartWidth?: PropertyValue<'borderInlineStartWidth'>
borderLeft?: PropertyValue<'borderLeft'>
borderLeftColor?: PropertyValue<'borderLeftColor'>
borderLeftStyle?: PropertyValue<'borderLeftStyle'>
borderLeftWidth?: PropertyValue<'borderLeftWidth'>
borderRadius?: PropertyValue<'borderRadius'>
borderRight?: PropertyValue<'borderRight'>
borderRightColor?: PropertyValue<'borderRightColor'>
borderRightStyle?: PropertyValue<'borderRightStyle'>
borderRightWidth?: PropertyValue<'borderRightWidth'>
borderSpacing?: PropertyValue<'borderSpacing'>
borderStartEndRadius?: PropertyValue<'borderStartEndRadius'>
borderStartStartRadius?: PropertyValue<'borderStartStartRadius'>
borderStyle?: PropertyValue<'borderStyle'>
borderTop?: PropertyValue<'borderTop'>
borderTopColor?: PropertyValue<'borderTopColor'>
borderTopLeftRadius?: PropertyValue<'borderTopLeftRadius'>
borderTopRightRadius?: PropertyValue<'borderTopRightRadius'>
borderTopStyle?: PropertyValue<'borderTopStyle'>
borderTopWidth?: PropertyValue<'borderTopWidth'>
borderWidth?: PropertyValue<'borderWidth'>
bottom?: PropertyValue<'bottom'>
boxAlign?: PropertyValue<'boxAlign'>
boxDecorationBreak?: PropertyValue<'boxDecorationBreak'>
boxDirection?: PropertyValue<'boxDirection'>
boxFlex?: PropertyValue<'boxFlex'>
boxFlexGroup?: PropertyValue<'boxFlexGroup'>
boxLines?: PropertyValue<'boxLines'>
boxOrdinalGroup?: PropertyValue<'boxOrdinalGroup'>
boxOrient?: PropertyValue<'boxOrient'>
boxPack?: PropertyValue<'boxPack'>
boxShadow?: PropertyValue<'boxShadow'>
boxSizing?: PropertyValue<'boxSizing'>
breakAfter?: PropertyValue<'breakAfter'>
breakBefore?: PropertyValue<'breakBefore'>
breakInside?: PropertyValue<'breakInside'>
captionSide?: PropertyValue<'captionSide'>
caret?: PropertyValue<'caret'>
caretColor?: PropertyValue<'caretColor'>
caretShape?: PropertyValue<'caretShape'>
clear?: PropertyValue<'clear'>
clip?: PropertyValue<'clip'>
clipPath?: PropertyValue<'clipPath'>
color?: PropertyValue<'color'>
colorScheme?: PropertyValue<'colorScheme'>
columnCount?: PropertyValue<'columnCount'>
columnFill?: PropertyValue<'columnFill'>
columnGap?: PropertyValue<'columnGap'>
columnRule?: PropertyValue<'columnRule'>
columnRuleColor?: PropertyValue<'columnRuleColor'>
columnRuleStyle?: PropertyValue<'columnRuleStyle'>
columnRuleWidth?: PropertyValue<'columnRuleWidth'>
columnSpan?: PropertyValue<'columnSpan'>
columnWidth?: PropertyValue<'columnWidth'>
columns?: PropertyValue<'columns'>
contain?: PropertyValue<'contain'>
containIntrinsicSize?: PropertyValue<'containIntrinsicSize'>
containIntrinsicBlockSize?: PropertyValue<'containIntrinsicBlockSize'>
containIntrinsicHeight?: PropertyValue<'containIntrinsicHeight'>
containIntrinsicInlineSize?: PropertyValue<'containIntrinsicInlineSize'>
containIntrinsicWidth?: PropertyValue<'containIntrinsicWidth'>
container?: PropertyValue<'container'>
containerName?: PropertyValue<'containerName'>
containerType?: PropertyValue<'containerType'>
content?: PropertyValue<'content'>
contentVisibility?: PropertyValue<'contentVisibility'>
counterIncrement?: PropertyValue<'counterIncrement'>
counterReset?: PropertyValue<'counterReset'>
counterSet?: PropertyValue<'counterSet'>
cursor?: PropertyValue<'cursor'>
direction?: PropertyValue<'direction'>
display?: PropertyValue<'display'>
emptyCells?: PropertyValue<'emptyCells'>
filter?: PropertyValue<'filter'>
flex?: PropertyValue<'flex'>
flexBasis?: PropertyValue<'flexBasis'>
flexDirection?: PropertyValue<'flexDirection'>
flexFlow?: PropertyValue<'flexFlow'>
flexGrow?: PropertyValue<'flexGrow'>
flexShrink?: PropertyValue<'flexShrink'>
flexWrap?: PropertyValue<'flexWrap'>
float?: PropertyValue<'float'>
font?: PropertyValue<'font'>
fontFamily?: PropertyValue<'fontFamily'>
fontFeatureSettings?: PropertyValue<'fontFeatureSettings'>
fontKerning?: PropertyValue<'fontKerning'>
fontLanguageOverride?: PropertyValue<'fontLanguageOverride'>
fontOpticalSizing?: PropertyValue<'fontOpticalSizing'>
fontPalette?: PropertyValue<'fontPalette'>
fontVariationSettings?: PropertyValue<'fontVariationSettings'>
fontSize?: PropertyValue<'fontSize'>
fontSizeAdjust?: PropertyValue<'fontSizeAdjust'>
fontSmooth?: PropertyValue<'fontSmooth'>
fontStretch?: PropertyValue<'fontStretch'>
fontStyle?: PropertyValue<'fontStyle'>
fontSynthesis?: PropertyValue<'fontSynthesis'>
fontVariant?: PropertyValue<'fontVariant'>
fontVariantAlternates?: PropertyValue<'fontVariantAlternates'>
fontVariantCaps?: PropertyValue<'fontVariantCaps'>
fontVariantEastAsian?: PropertyValue<'fontVariantEastAsian'>
fontVariantEmoji?: PropertyValue<'fontVariantEmoji'>
fontVariantLigatures?: PropertyValue<'fontVariantLigatures'>
fontVariantNumeric?: PropertyValue<'fontVariantNumeric'>
fontVariantPosition?: PropertyValue<'fontVariantPosition'>
fontWeight?: PropertyValue<'fontWeight'>
forcedColorAdjust?: PropertyValue<'forcedColorAdjust'>
gap?: PropertyValue<'gap'>
grid?: PropertyValue<'grid'>
gridArea?: PropertyValue<'gridArea'>
gridAutoColumns?: PropertyValue<'gridAutoColumns'>
gridAutoFlow?: PropertyValue<'gridAutoFlow'>
gridAutoRows?: PropertyValue<'gridAutoRows'>
gridColumn?: PropertyValue<'gridColumn'>
gridColumnEnd?: PropertyValue<'gridColumnEnd'>
gridColumnGap?: PropertyValue<'gridColumnGap'>
gridColumnStart?: PropertyValue<'gridColumnStart'>
gridGap?: PropertyValue<'gridGap'>
gridRow?: PropertyValue<'gridRow'>
gridRowEnd?: PropertyValue<'gridRowEnd'>
gridRowGap?: PropertyValue<'gridRowGap'>
gridRowStart?: PropertyValue<'gridRowStart'>
gridTemplate?: PropertyValue<'gridTemplate'>
gridTemplateAreas?: PropertyValue<'gridTemplateAreas'>
gridTemplateColumns?: PropertyValue<'gridTemplateColumns'>
gridTemplateRows?: PropertyValue<'gridTemplateRows'>
hangingPunctuation?: PropertyValue<'hangingPunctuation'>
height?: PropertyValue<'height'>
hyphenateCharacter?: PropertyValue<'hyphenateCharacter'>
hyphenateLimitChars?: PropertyValue<'hyphenateLimitChars'>
hyphens?: PropertyValue<'hyphens'>
imageOrientation?: PropertyValue<'imageOrientation'>
imageRendering?: PropertyValue<'imageRendering'>
imageResolution?: PropertyValue<'imageResolution'>
imeMode?: PropertyValue<'imeMode'>
initialLetter?: PropertyValue<'initialLetter'>
initialLetterAlign?: PropertyValue<'initialLetterAlign'>
inlineSize?: PropertyValue<'inlineSize'>
inputSecurity?: PropertyValue<'inputSecurity'>
inset?: PropertyValue<'inset'>
insetBlock?: PropertyValue<'insetBlock'>
insetBlockEnd?: PropertyValue<'insetBlockEnd'>
insetBlockStart?: PropertyValue<'insetBlockStart'>
insetInline?: PropertyValue<'insetInline'>
insetInlineEnd?: PropertyValue<'insetInlineEnd'>
insetInlineStart?: PropertyValue<'insetInlineStart'>
isolation?: PropertyValue<'isolation'>
justifyContent?: PropertyValue<'justifyContent'>
justifyItems?: PropertyValue<'justifyItems'>
justifySelf?: PropertyValue<'justifySelf'>
justifyTracks?: PropertyValue<'justifyTracks'>
left?: PropertyValue<'left'>
letterSpacing?: PropertyValue<'letterSpacing'>
lineBreak?: PropertyValue<'lineBreak'>
lineClamp?: PropertyValue<'lineClamp'>
lineHeight?: PropertyValue<'lineHeight'>
lineHeightStep?: PropertyValue<'lineHeightStep'>
listStyle?: PropertyValue<'listStyle'>
listStyleImage?: PropertyValue<'listStyleImage'>
listStylePosition?: PropertyValue<'listStylePosition'>
listStyleType?: PropertyValue<'listStyleType'>
margin?: PropertyValue<'margin'>
marginBlock?: PropertyValue<'marginBlock'>
marginBlockEnd?: PropertyValue<'marginBlockEnd'>
marginBlockStart?: PropertyValue<'marginBlockStart'>
marginBottom?: PropertyValue<'marginBottom'>
marginInline?: PropertyValue<'marginInline'>
marginInlineEnd?: PropertyValue<'marginInlineEnd'>
marginInlineStart?: PropertyValue<'marginInlineStart'>
marginLeft?: PropertyValue<'marginLeft'>
marginRight?: PropertyValue<'marginRight'>
marginTop?: PropertyValue<'marginTop'>
marginTrim?: PropertyValue<'marginTrim'>
mask?: PropertyValue<'mask'>
maskBorder?: PropertyValue<'maskBorder'>
maskBorderMode?: PropertyValue<'maskBorderMode'>
maskBorderOutset?: PropertyValue<'maskBorderOutset'>
maskBorderRepeat?: PropertyValue<'maskBorderRepeat'>
maskBorderSlice?: PropertyValue<'maskBorderSlice'>
maskBorderSource?: PropertyValue<'maskBorderSource'>
maskBorderWidth?: PropertyValue<'maskBorderWidth'>
maskClip?: PropertyValue<'maskClip'>
maskComposite?: PropertyValue<'maskComposite'>
maskImage?: PropertyValue<'maskImage'>
maskMode?: PropertyValue<'maskMode'>
maskOrigin?: PropertyValue<'maskOrigin'>
maskPosition?: PropertyValue<'maskPosition'>
maskRepeat?: PropertyValue<'maskRepeat'>
maskSize?: PropertyValue<'maskSize'>
maskType?: PropertyValue<'maskType'>
masonryAutoFlow?: PropertyValue<'masonryAutoFlow'>
mathDepth?: PropertyValue<'mathDepth'>
mathShift?: PropertyValue<'mathShift'>
mathStyle?: PropertyValue<'mathStyle'>
maxBlockSize?: PropertyValue<'maxBlockSize'>
maxHeight?: PropertyValue<'maxHeight'>
maxInlineSize?: PropertyValue<'maxInlineSize'>
maxLines?: PropertyValue<'maxLines'>
maxWidth?: PropertyValue<'maxWidth'>
minBlockSize?: PropertyValue<'minBlockSize'>
minHeight?: PropertyValue<'minHeight'>
minInlineSize?: PropertyValue<'minInlineSize'>
minWidth?: PropertyValue<'minWidth'>
mixBlendMode?: PropertyValue<'mixBlendMode'>
objectFit?: PropertyValue<'objectFit'>
objectPosition?: PropertyValue<'objectPosition'>
offset?: PropertyValue<'offset'>
offsetAnchor?: PropertyValue<'offsetAnchor'>
offsetDistance?: PropertyValue<'offsetDistance'>
offsetPath?: PropertyValue<'offsetPath'>
offsetPosition?: PropertyValue<'offsetPosition'>
offsetRotate?: PropertyValue<'offsetRotate'>
opacity?: PropertyValue<'opacity'>
order?: PropertyValue<'order'>
orphans?: PropertyValue<'orphans'>
outline?: PropertyValue<'outline'>
outlineColor?: PropertyValue<'outlineColor'>
outlineOffset?: PropertyValue<'outlineOffset'>
outlineStyle?: PropertyValue<'outlineStyle'>
outlineWidth?: PropertyValue<'outlineWidth'>
overflow?: PropertyValue<'overflow'>
overflowAnchor?: PropertyValue<'overflowAnchor'>
overflowBlock?: PropertyValue<'overflowBlock'>
overflowClipBox?: PropertyValue<'overflowClipBox'>
overflowClipMargin?: PropertyValue<'overflowClipMargin'>
overflowInline?: PropertyValue<'overflowInline'>
overflowWrap?: PropertyValue<'overflowWrap'>
overflowX?: PropertyValue<'overflowX'>
overflowY?: PropertyValue<'overflowY'>
overscrollBehavior?: PropertyValue<'overscrollBehavior'>
overscrollBehaviorBlock?: PropertyValue<'overscrollBehaviorBlock'>
overscrollBehaviorInline?: PropertyValue<'overscrollBehaviorInline'>
overscrollBehaviorX?: PropertyValue<'overscrollBehaviorX'>
overscrollBehaviorY?: PropertyValue<'overscrollBehaviorY'>
padding?: PropertyValue<'padding'>
paddingBlock?: PropertyValue<'paddingBlock'>
paddingBlockEnd?: PropertyValue<'paddingBlockEnd'>
paddingBlockStart?: PropertyValue<'paddingBlockStart'>
paddingBottom?: PropertyValue<'paddingBottom'>
paddingInline?: PropertyValue<'paddingInline'>
paddingInlineEnd?: PropertyValue<'paddingInlineEnd'>
paddingInlineStart?: PropertyValue<'paddingInlineStart'>
paddingLeft?: PropertyValue<'paddingLeft'>
paddingRight?: PropertyValue<'paddingRight'>
paddingTop?: PropertyValue<'paddingTop'>
page?: PropertyValue<'page'>
pageBreakAfter?: PropertyValue<'pageBreakAfter'>
pageBreakBefore?: PropertyValue<'pageBreakBefore'>
pageBreakInside?: PropertyValue<'pageBreakInside'>
paintOrder?: PropertyValue<'paintOrder'>
perspective?: PropertyValue<'perspective'>
perspectiveOrigin?: PropertyValue<'perspectiveOrigin'>
placeContent?: PropertyValue<'placeContent'>
placeItems?: PropertyValue<'placeItems'>
placeSelf?: PropertyValue<'placeSelf'>
pointerEvents?: PropertyValue<'pointerEvents'>
position?: PropertyValue<'position'>
printColorAdjust?: PropertyValue<'printColorAdjust'>
quotes?: PropertyValue<'quotes'>
resize?: PropertyValue<'resize'>
right?: PropertyValue<'right'>
rotate?: PropertyValue<'rotate'>
rowGap?: PropertyValue<'rowGap'>
rubyAlign?: PropertyValue<'rubyAlign'>
rubyMerge?: PropertyValue<'rubyMerge'>
rubyPosition?: PropertyValue<'rubyPosition'>
scale?: PropertyValue<'scale'>
scrollbarColor?: PropertyValue<'scrollbarColor'>
scrollbarGutter?: PropertyValue<'scrollbarGutter'>
scrollbarWidth?: PropertyValue<'scrollbarWidth'>
scrollBehavior?: PropertyValue<'scrollBehavior'>
scrollMargin?: PropertyValue<'scrollMargin'>
scrollMarginBlock?: PropertyValue<'scrollMarginBlock'>
scrollMarginBlockStart?: PropertyValue<'scrollMarginBlockStart'>
scrollMarginBlockEnd?: PropertyValue<'scrollMarginBlockEnd'>
scrollMarginBottom?: PropertyValue<'scrollMarginBottom'>
scrollMarginInline?: PropertyValue<'scrollMarginInline'>
scrollMarginInlineStart?: PropertyValue<'scrollMarginInlineStart'>
scrollMarginInlineEnd?: PropertyValue<'scrollMarginInlineEnd'>
scrollMarginLeft?: PropertyValue<'scrollMarginLeft'>
scrollMarginRight?: PropertyValue<'scrollMarginRight'>
scrollMarginTop?: PropertyValue<'scrollMarginTop'>
scrollPadding?: PropertyValue<'scrollPadding'>
scrollPaddingBlock?: PropertyValue<'scrollPaddingBlock'>
scrollPaddingBlockStart?: PropertyValue<'scrollPaddingBlockStart'>
scrollPaddingBlockEnd?: PropertyValue<'scrollPaddingBlockEnd'>
scrollPaddingBottom?: PropertyValue<'scrollPaddingBottom'>
scrollPaddingInline?: PropertyValue<'scrollPaddingInline'>
scrollPaddingInlineStart?: PropertyValue<'scrollPaddingInlineStart'>
scrollPaddingInlineEnd?: PropertyValue<'scrollPaddingInlineEnd'>
scrollPaddingLeft?: PropertyValue<'scrollPaddingLeft'>
scrollPaddingRight?: PropertyValue<'scrollPaddingRight'>
scrollPaddingTop?: PropertyValue<'scrollPaddingTop'>
scrollSnapAlign?: PropertyValue<'scrollSnapAlign'>
scrollSnapCoordinate?: PropertyValue<'scrollSnapCoordinate'>
scrollSnapDestination?: PropertyValue<'scrollSnapDestination'>
scrollSnapPointsX?: PropertyValue<'scrollSnapPointsX'>
scrollSnapPointsY?: PropertyValue<'scrollSnapPointsY'>
scrollSnapStop?: PropertyValue<'scrollSnapStop'>
scrollSnapType?: PropertyValue<'scrollSnapType'>
scrollSnapTypeX?: PropertyValue<'scrollSnapTypeX'>
scrollSnapTypeY?: PropertyValue<'scrollSnapTypeY'>
scrollTimeline?: PropertyValue<'scrollTimeline'>
scrollTimelineAxis?: PropertyValue<'scrollTimelineAxis'>
scrollTimelineName?: PropertyValue<'scrollTimelineName'>
shapeImageThreshold?: PropertyValue<'shapeImageThreshold'>
shapeMargin?: PropertyValue<'shapeMargin'>
shapeOutside?: PropertyValue<'shapeOutside'>
tabSize?: PropertyValue<'tabSize'>
tableLayout?: PropertyValue<'tableLayout'>
textAlign?: PropertyValue<'textAlign'>
textAlignLast?: PropertyValue<'textAlignLast'>
textCombineUpright?: PropertyValue<'textCombineUpright'>
textDecoration?: PropertyValue<'textDecoration'>
textDecorationColor?: PropertyValue<'textDecorationColor'>
textDecorationLine?: PropertyValue<'textDecorationLine'>
textDecorationSkip?: PropertyValue<'textDecorationSkip'>
textDecorationSkipInk?: PropertyValue<'textDecorationSkipInk'>
textDecorationStyle?: PropertyValue<'textDecorationStyle'>
textDecorationThickness?: PropertyValue<'textDecorationThickness'>
textEmphasis?: PropertyValue<'textEmphasis'>
textEmphasisColor?: PropertyValue<'textEmphasisColor'>
textEmphasisPosition?: PropertyValue<'textEmphasisPosition'>
textEmphasisStyle?: PropertyValue<'textEmphasisStyle'>
textIndent?: PropertyValue<'textIndent'>
textJustify?: PropertyValue<'textJustify'>
textOrientation?: PropertyValue<'textOrientation'>
textOverflow?: PropertyValue<'textOverflow'>
textRendering?: PropertyValue<'textRendering'>
textShadow?: PropertyValue<'textShadow'>
textSizeAdjust?: PropertyValue<'textSizeAdjust'>
textTransform?: PropertyValue<'textTransform'>
textUnderlineOffset?: PropertyValue<'textUnderlineOffset'>
textUnderlinePosition?: PropertyValue<'textUnderlinePosition'>
top?: PropertyValue<'top'>
touchAction?: PropertyValue<'touchAction'>
transform?: PropertyValue<'transform'>
transformBox?: PropertyValue<'transformBox'>
transformOrigin?: PropertyValue<'transformOrigin'>
transformStyle?: PropertyValue<'transformStyle'>
transition?: PropertyValue<'transition'>
transitionDelay?: PropertyValue<'transitionDelay'>
transitionDuration?: PropertyValue<'transitionDuration'>
transitionProperty?: PropertyValue<'transitionProperty'>
transitionTimingFunction?: PropertyValue<'transitionTimingFunction'>
translate?: PropertyValue<'translate'>
unicodeBidi?: PropertyValue<'unicodeBidi'>
userSelect?: PropertyValue<'userSelect'>
verticalAlign?: PropertyValue<'verticalAlign'>
viewTransitionName?: PropertyValue<'viewTransitionName'>
visibility?: PropertyValue<'visibility'>
whiteSpace?: PropertyValue<'whiteSpace'>
widows?: PropertyValue<'widows'>
width?: PropertyValue<'width'>
willChange?: PropertyValue<'willChange'>
wordBreak?: PropertyValue<'wordBreak'>
wordSpacing?: PropertyValue<'wordSpacing'>
wordWrap?: PropertyValue<'wordWrap'>
writingMode?: PropertyValue<'writingMode'>
zIndex?: PropertyValue<'zIndex'>
zoom?: PropertyValue<'zoom'>
alignmentBaseline?: PropertyValue<'alignmentBaseline'>
baselineShift?: PropertyValue<'baselineShift'>
clipRule?: PropertyValue<'clipRule'>
colorInterpolation?: PropertyValue<'colorInterpolation'>
colorRendering?: PropertyValue<'colorRendering'>
dominantBaseline?: PropertyValue<'dominantBaseline'>
fill?: PropertyValue<'fill'>
fillOpacity?: PropertyValue<'fillOpacity'>
fillRule?: PropertyValue<'fillRule'>
floodColor?: PropertyValue<'floodColor'>
floodOpacity?: PropertyValue<'floodOpacity'>
glyphOrientationVertical?: PropertyValue<'glyphOrientationVertical'>
lightingColor?: PropertyValue<'lightingColor'>
marker?: PropertyValue<'marker'>
markerEnd?: PropertyValue<'markerEnd'>
markerMid?: PropertyValue<'markerMid'>
markerStart?: PropertyValue<'markerStart'>
shapeRendering?: PropertyValue<'shapeRendering'>
stopColor?: PropertyValue<'stopColor'>
stopOpacity?: PropertyValue<'stopOpacity'>
stroke?: PropertyValue<'stroke'>
strokeDasharray?: PropertyValue<'strokeDasharray'>
strokeDashoffset?: PropertyValue<'strokeDashoffset'>
strokeLinecap?: PropertyValue<'strokeLinecap'>
strokeLinejoin?: PropertyValue<'strokeLinejoin'>
strokeMiterlimit?: PropertyValue<'strokeMiterlimit'>
strokeOpacity?: PropertyValue<'strokeOpacity'>
strokeWidth?: PropertyValue<'strokeWidth'>
textAnchor?: PropertyValue<'textAnchor'>
vectorEffect?: PropertyValue<'vectorEffect'>
pos?: PropertyValue<'pos'>
insetEnd?: PropertyValue<'insetEnd'>
end?: PropertyValue<'end'>
insetStart?: PropertyValue<'insetStart'>
start?: PropertyValue<'start'>
flexDir?: PropertyValue<'flexDir'>
p?: PropertyValue<'p'>
pl?: PropertyValue<'pl'>
pr?: PropertyValue<'pr'>
pt?: PropertyValue<'pt'>
pb?: PropertyValue<'pb'>
py?: PropertyValue<'py'>
paddingY?: PropertyValue<'paddingY'>
paddingX?: PropertyValue<'paddingX'>
px?: PropertyValue<'px'>
pe?: PropertyValue<'pe'>
paddingEnd?: PropertyValue<'paddingEnd'>
ps?: PropertyValue<'ps'>
paddingStart?: PropertyValue<'paddingStart'>
ml?: PropertyValue<'ml'>
mr?: PropertyValue<'mr'>
mt?: PropertyValue<'mt'>
mb?: PropertyValue<'mb'>
m?: PropertyValue<'m'>
my?: PropertyValue<'my'>
marginY?: PropertyValue<'marginY'>
mx?: PropertyValue<'mx'>
marginX?: PropertyValue<'marginX'>
me?: PropertyValue<'me'>
marginEnd?: PropertyValue<'marginEnd'>
ms?: PropertyValue<'ms'>
marginStart?: PropertyValue<'marginStart'>
ringWidth?: PropertyValue<'ringWidth'>
ringColor?: PropertyValue<'ringColor'>
ring?: PropertyValue<'ring'>
ringOffset?: PropertyValue<'ringOffset'>
w?: PropertyValue<'w'>
minW?: PropertyValue<'minW'>
maxW?: PropertyValue<'maxW'>
h?: PropertyValue<'h'>
minH?: PropertyValue<'minH'>
maxH?: PropertyValue<'maxH'>
bgPosition?: PropertyValue<'bgPosition'>
bgPositionX?: PropertyValue<'bgPositionX'>
bgPositionY?: PropertyValue<'bgPositionY'>
bgAttachment?: PropertyValue<'bgAttachment'>
bgClip?: PropertyValue<'bgClip'>
bg?: PropertyValue<'bg'>
bgColor?: PropertyValue<'bgColor'>
bgOrigin?: PropertyValue<'bgOrigin'>
bgImage?: PropertyValue<'bgImage'>
bgRepeat?: PropertyValue<'bgRepeat'>
bgBlendMode?: PropertyValue<'bgBlendMode'>
bgSize?: PropertyValue<'bgSize'>
bgGradient?: PropertyValue<'bgGradient'>
rounded?: PropertyValue<'rounded'>
roundedTopLeft?: PropertyValue<'roundedTopLeft'>
roundedTopRight?: PropertyValue<'roundedTopRight'>
roundedBottomRight?: PropertyValue<'roundedBottomRight'>
roundedBottomLeft?: PropertyValue<'roundedBottomLeft'>
roundedTop?: PropertyValue<'roundedTop'>
roundedRight?: PropertyValue<'roundedRight'>
roundedBottom?: PropertyValue<'roundedBottom'>
roundedLeft?: PropertyValue<'roundedLeft'>
roundedStartStart?: PropertyValue<'roundedStartStart'>
roundedStartEnd?: PropertyValue<'roundedStartEnd'>
roundedStart?: PropertyValue<'roundedStart'>
roundedEndStart?: PropertyValue<'roundedEndStart'>
roundedEndEnd?: PropertyValue<'roundedEndEnd'>
roundedEnd?: PropertyValue<'roundedEnd'>
borderX?: PropertyValue<'borderX'>
borderXWidth?: PropertyValue<'borderXWidth'>
borderXColor?: PropertyValue<'borderXColor'>
borderY?: PropertyValue<'borderY'>
borderYWidth?: PropertyValue<'borderYWidth'>
borderYColor?: PropertyValue<'borderYColor'>
borderStart?: PropertyValue<'borderStart'>
borderStartWidth?: PropertyValue<'borderStartWidth'>
borderStartColor?: PropertyValue<'borderStartColor'>
borderEnd?: PropertyValue<'borderEnd'>
borderEndWidth?: PropertyValue<'borderEndWidth'>
borderEndColor?: PropertyValue<'borderEndColor'>
shadow?: PropertyValue<'shadow'>
shadowColor?: PropertyValue<'shadowColor'>
x?: PropertyValue<'x'>
y?: PropertyValue<'y'>
insetX?: PropertyValue<'insetX'>
insetY?: PropertyValue<'insetY'>
hideFrom?: PropertyValue<'hideFrom'>
hideBelow?: PropertyValue<'hideBelow'>
divideX?: PropertyValue<'divideX'>
divideY?: PropertyValue<'divideY'>
divideColor?: PropertyValue<'divideColor'>
divideStyle?: PropertyValue<'divideStyle'>
fontSmoothing?: PropertyValue<'fontSmoothing'>
textWrap?: PropertyValue<'textWrap'>
truncate?: PropertyValue<'truncate'>
backgroundGradient?: PropertyValue<'backgroundGradient'>
textGradient?: PropertyValue<'textGradient'>
gradientFrom?: PropertyValue<'gradientFrom'>
gradientTo?: PropertyValue<'gradientTo'>
gradientVia?: PropertyValue<'gradientVia'>
borderTopRadius?: PropertyValue<'borderTopRadius'>
borderRightRadius?: PropertyValue<'borderRightRadius'>
borderBottomRadius?: PropertyValue<'borderBottomRadius'>
borderLeftRadius?: PropertyValue<'borderLeftRadius'>
borderStartRadius?: PropertyValue<'borderStartRadius'>
borderEndRadius?: PropertyValue<'borderEndRadius'>
boxShadowColor?: PropertyValue<'boxShadowColor'>
brightness?: PropertyValue<'brightness'>
contrast?: PropertyValue<'contrast'>
grayscale?: PropertyValue<'grayscale'>
hueRotate?: PropertyValue<'hueRotate'>
invert?: PropertyValue<'invert'>
saturate?: PropertyValue<'saturate'>
sepia?: PropertyValue<'sepia'>
dropShadow?: PropertyValue<'dropShadow'>
blur?: PropertyValue<'blur'>
backdropBlur?: PropertyValue<'backdropBlur'>
backdropBrightness?: PropertyValue<'backdropBrightness'>
backdropContrast?: PropertyValue<'backdropContrast'>
backdropGrayscale?: PropertyValue<'backdropGrayscale'>
backdropHueRotate?: PropertyValue<'backdropHueRotate'>
backdropInvert?: PropertyValue<'backdropInvert'>
backdropOpacity?: PropertyValue<'backdropOpacity'>
backdropSaturate?: PropertyValue<'backdropSaturate'>
backdropSepia?: PropertyValue<'backdropSepia'>
borderSpacingX?: PropertyValue<'borderSpacingX'>
borderSpacingY?: PropertyValue<'borderSpacingY'>
scaleX?: PropertyValue<'scaleX'>
scaleY?: PropertyValue<'scaleY'>
translateX?: PropertyValue<'translateX'>
translateY?: PropertyValue<'translateY'>
scrollbar?: PropertyValue<'scrollbar'>
scrollMarginX?: PropertyValue<'scrollMarginX'>
scrollMarginY?: PropertyValue<'scrollMarginY'>
scrollPaddingX?: PropertyValue<'scrollPaddingX'>
scrollPaddingY?: PropertyValue<'scrollPaddingY'>
scrollSnapStrictness?: PropertyValue<'scrollSnapStrictness'>
scrollSnapMargin?: PropertyValue<'scrollSnapMargin'>
scrollSnapMarginTop?: PropertyValue<'scrollSnapMarginTop'>
scrollSnapMarginBottom?: PropertyValue<'scrollSnapMarginBottom'>
scrollSnapMarginLeft?: PropertyValue<'scrollSnapMarginLeft'>
scrollSnapMarginRight?: PropertyValue<'scrollSnapMarginRight'>
srOnly?: PropertyValue<'srOnly'>
debug?: PropertyValue<'debug'>
colorPalette?: PropertyValue<'colorPalette'>
textStyle?: PropertyValue<'textStyle'>
}

View File

@ -0,0 +1,79 @@
/* eslint-disable */
import type { ConditionalValue, Conditions, Nested } from './conditions'
import type { PropertiesFallback } from './csstype'
import type { SystemProperties, CssVarProperties } from './style-props'
type String = string & {}
type Number = number & {}
/* -----------------------------------------------------------------------------
* Native css properties
* -----------------------------------------------------------------------------*/
export type CssProperty = keyof PropertiesFallback
export type CssProperties = PropertiesFallback<String | Number> & CssVarProperties
export type CssKeyframes = {
[name: string]: {
[time: string]: CssProperties
}
}
/* -----------------------------------------------------------------------------
* Conditional css properties
* -----------------------------------------------------------------------------*/
type MinimalNested<P> = {
[K in keyof Conditions]?: Nested<P>
}
type GenericProperties = {
[key: string]: ConditionalValue<String | Number | boolean>
}
/* -----------------------------------------------------------------------------
* Native css props
* -----------------------------------------------------------------------------*/
export type NestedCssProperties = Nested<CssProperties>
export type SystemStyleObject = Nested<SystemProperties & CssVarProperties>
export type GlobalStyleObject = {
[selector: string]: SystemStyleObject
}
export type CompositionStyleObject<Property extends string> = Nested<{
[K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown
}>
/* -----------------------------------------------------------------------------
* Jsx style props
* -----------------------------------------------------------------------------*/
type WithCss = { css?: SystemStyleObject }
type StyleProps = SystemProperties & MinimalNested<SystemStyleObject>
export type JsxStyleProps = StyleProps & WithCss
export type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never
export type Assign<T, U> = {
[K in keyof T]: K extends keyof U ? U[K] : T[K]
} & U
export type PatchedHTMLProps = {
htmlWidth?: string | number
htmlHeight?: string | number
htmlTranslate?: 'yes' | 'no' | undefined
htmlContent?: string
}
export type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'
type WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps
export type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<
WithHTMLProps<T>,
P
>

2181
src/tarteauxmyrtilles.ts Normal file

File diff suppressed because it is too large Load Diff

1
src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@ -1,111 +1,32 @@
{ {
"compilerOptions": { "compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */ "target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Projects */ /* Bundler mode */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ "moduleResolution": "bundler",
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ "allowImportingTsExtensions": true,
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ "resolveJsonModule": true,
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ "isolatedModules": true,
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ "noEmit": true,
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ "jsx": "react-jsx",
"jsxImportSource": "preact",
/* Language and Environment */ /* Linting */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ "strict": true,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ "noUnusedLocals": true,
// "jsx": "preserve", /* Specify what JSX code is generated. */ "noUnusedParameters": true,
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ "noFallthroughCasesInSwitch": true,
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ "typeRoots": ["./node_modules/@types", "./src/types", "./types"],
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ "baseUrl": "./",
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"rootDir": "./src", "rootDir": "./src",
"outDir": "./dist" "paths": {
} "@/*": ["./src/*"]
}
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
} }

10
tsconfig.node.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

9
types/index.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
import TarteAuxMyrtilles from "@/tarteaumyrtilles";
import type { Service as TarteService } from "@/services";
declare global {
interface Window {
tarteauxmyrtilles: TarteAuxMyrtilles;
}
type Service = TarteService;
}

29
vite.config.ts Normal file
View File

@ -0,0 +1,29 @@
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact()],
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
build: {
lib: {
entry: resolve(__dirname, "src/main.tsx"),
name: "tarteauxmyrtilles",
fileName: (format) => `tarteauxmyrtilles.${format}.js`,
formats: ["es", "iife"],
},
// rollupOptions: {
// external: ["preact"],
// output: {
// globals: {
// preact: "preact",
// },
// },
// },
},
});