@jamsrui/utils 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VU5FLTAB.mjs → chunk-HTHA4AOA.mjs} +1 -1
- package/dist/{chunk-66JMA2IB.mjs → chunk-YLASFKHR.mjs} +1 -1
- package/dist/context.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/merge-props.mjs +1 -1
- package/package.json +1 -1
- package/dist/attr.d.mts +0 -6
- package/dist/class-names.d.mts +0 -60
- package/dist/cn.d.mts +0 -5
- package/dist/context.d.mts +0 -10
- package/dist/index.d.mts +0 -12
- package/dist/merge-props.d.mts +0 -7
- package/dist/object.d.mts +0 -4
- package/dist/transition.d.mts +0 -18
- package/dist/tv.d.mts +0 -23
- package/dist/types.d.mts +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-N4MX2VP2.mjs";var p=(...
|
|
1
|
+
import{a as m}from"./chunk-N4MX2VP2.mjs";var p=(...c)=>{let o=c.filter(Boolean),t=Object.assign({},...o),r=o.map(s=>s.classNames).filter(Boolean);r.length>0&&(t.classNames={},new Set(r.flatMap(e=>Object.keys(e))).forEach(e=>{let n=r.map(f=>f[e]).filter(Boolean);n.length>0&&(t.classNames[e]=m(n.join(" ")))})),t.slots&&(t.slots=o.reduce((s,e)=>({...s,...e.slots}),{}));let a=o.map(s=>s.className).filter(Boolean);a.length>0&&(t.className=m(a.join(" ")));let i=o.map(s=>s.style).filter(Boolean);i.length>0&&(t.style=Object.assign({},...i));let l=new Set;return o.forEach(s=>{Object.keys(s).forEach(e=>{e.startsWith("on")&&typeof s[e]=="function"&&l.add(e)})}),l.forEach(s=>{let e=o.map(n=>n[s]).filter(Boolean).reverse();e.length>0&&(t[s]=n=>{e.forEach(f=>f(n))})}),t},P=(c,o,t)=>{let{props:r,omitProps:a,slots:i,...l}=o,s=a?.length?Object.fromEntries(Object.entries(t).filter(([n])=>!a.includes(n))):t,e=p(c,l,t);return p(l,r?.(e),s)};export{p as a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-HTHA4AOA.mjs";import{createContext as m,use as l}from"react";import{jsx as p}from"react/jsx-runtime";var P=({displayName:r})=>{let e=m({});e.displayName=r;let n=()=>l(e);return[s=>{let{merge:i=!0,...o}=s,a=n(),c=i?t(a,o):o,{children:d,...g}=c;return p(e,{value:g,children:d})},n]};export{P as a};
|
package/dist/context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-YLASFKHR.mjs";import"./chunk-HTHA4AOA.mjs";import"./chunk-N4MX2VP2.mjs";export{a as createConfigContext};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T,b as c,c as d}from"./chunk-OGYIPZ7T.mjs";import{a as s,b as e,c as r}from"./chunk-YEUPOEOF.mjs";import{a as t,b as a,c as o,d as l,e as p,f as i,g as n,h as m,i as C}from"./chunk-APQ2BZBK.mjs";import{a as x}from"./chunk-
|
|
1
|
+
import{a as T,b as c,c as d}from"./chunk-OGYIPZ7T.mjs";import{a as s,b as e,c as r}from"./chunk-YEUPOEOF.mjs";import{a as t,b as a,c as o,d as l,e as p,f as i,g as n,h as m,i as C}from"./chunk-APQ2BZBK.mjs";import{a as x}from"./chunk-YLASFKHR.mjs";import{a as f,b as u}from"./chunk-HTHA4AOA.mjs";import{a as V}from"./chunk-N4MX2VP2.mjs";import"./chunk-M7STMVRD.mjs";import{a as y}from"./chunk-DIQ43J5Y.mjs";import{tv as b}from"tailwind-variants";export{y as TRANSITION_VARIANTS,C as absoluteFullClasses,a as allColors,o as allVariants,V as cn,t as colorVariants,x as createConfigContext,r as dataAttr,s as dataAttrDev,p as dataFocusVisibleClasses,l as focusVisibleClasses,i as groupDataFocusVisibleClasses,e as isDisabledElement,T as mapPropsVariants,u as mergeConfigProps,f as mergeProps,c as radiusBaseVariant,d as radiusVariant,n as ringClasses,m as translateCenterClasses,b as tv};
|
package/dist/merge-props.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-HTHA4AOA.mjs";import"./chunk-N4MX2VP2.mjs";export{b as mergeConfigProps,a as mergeProps};
|
package/package.json
CHANGED
package/dist/attr.d.mts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const dataAttrDev: (value: string) => string | undefined;
|
|
2
|
-
declare const isDisabledElement: (element: HTMLElement) => boolean;
|
|
3
|
-
type Booleanish = boolean | "true" | "false";
|
|
4
|
-
declare const dataAttr: (condition: boolean | undefined) => Booleanish;
|
|
5
|
-
|
|
6
|
-
export { dataAttr, dataAttrDev, isDisabledElement };
|
package/dist/class-names.d.mts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
type Color = "default" | "primary" | "secondary" | "success" | "warning" | "danger";
|
|
2
|
-
type Variant = "solid" | "bordered" | "text" | "light" | "flat";
|
|
3
|
-
declare const colorVariants: {
|
|
4
|
-
solid: {
|
|
5
|
-
default: string;
|
|
6
|
-
primary: string;
|
|
7
|
-
secondary: string;
|
|
8
|
-
success: string;
|
|
9
|
-
warning: string;
|
|
10
|
-
danger: string;
|
|
11
|
-
};
|
|
12
|
-
bordered: {
|
|
13
|
-
default: string;
|
|
14
|
-
primary: string;
|
|
15
|
-
secondary: string;
|
|
16
|
-
success: string;
|
|
17
|
-
warning: string;
|
|
18
|
-
danger: string;
|
|
19
|
-
};
|
|
20
|
-
text: {
|
|
21
|
-
default: string;
|
|
22
|
-
primary: string;
|
|
23
|
-
secondary: string;
|
|
24
|
-
success: string;
|
|
25
|
-
warning: string;
|
|
26
|
-
danger: string;
|
|
27
|
-
};
|
|
28
|
-
light: {
|
|
29
|
-
default: string;
|
|
30
|
-
primary: string;
|
|
31
|
-
secondary: string;
|
|
32
|
-
success: string;
|
|
33
|
-
warning: string;
|
|
34
|
-
danger: string;
|
|
35
|
-
};
|
|
36
|
-
flat: {
|
|
37
|
-
default: string;
|
|
38
|
-
primary: string;
|
|
39
|
-
secondary: string;
|
|
40
|
-
success: string;
|
|
41
|
-
warning: string;
|
|
42
|
-
danger: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
declare const allColors: Color[];
|
|
46
|
-
declare const allVariants: Variant[];
|
|
47
|
-
/**
|
|
48
|
-
* focus classNames when the element is focused by keyboard.
|
|
49
|
-
*/
|
|
50
|
-
declare const focusVisibleClasses: string[];
|
|
51
|
-
declare const dataFocusVisibleClasses: string[];
|
|
52
|
-
declare const groupDataFocusVisibleClasses: string[];
|
|
53
|
-
declare const ringClasses: string[];
|
|
54
|
-
/**
|
|
55
|
-
* This classes centers the element by using absolute positioning.
|
|
56
|
-
*/
|
|
57
|
-
declare const translateCenterClasses: string[];
|
|
58
|
-
declare const absoluteFullClasses: string[];
|
|
59
|
-
|
|
60
|
-
export { absoluteFullClasses, allColors, allVariants, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, ringClasses, translateCenterClasses };
|
package/dist/cn.d.mts
DELETED
package/dist/context.d.mts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
declare const createConfigContext: <T extends Record<string, any>>({ displayName, }: {
|
|
4
|
-
displayName: string;
|
|
5
|
-
}) => readonly [(props: Omit<Partial<T>, "children"> & {
|
|
6
|
-
merge?: boolean;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element, () => T];
|
|
9
|
-
|
|
10
|
-
export { createConfigContext };
|
package/dist/index.d.mts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { ClassProp, ClassValue, TVReturnType, VariantProps, tv } from 'tailwind-variants';
|
|
2
|
-
export { dataAttr, dataAttrDev, isDisabledElement } from './attr.mjs';
|
|
3
|
-
export { cn } from './cn.mjs';
|
|
4
|
-
export { mergeConfigProps, mergeProps } from './merge-props.mjs';
|
|
5
|
-
export { mapPropsVariants, radiusBaseVariant, radiusVariant } from './tv.mjs';
|
|
6
|
-
export { PropGetter, SlotsToClassNames, SlotsToReactNode, UIProps, UnknownTV } from './types.mjs';
|
|
7
|
-
export { absoluteFullClasses, allColors, allVariants, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, ringClasses, translateCenterClasses } from './class-names.mjs';
|
|
8
|
-
export { createConfigContext } from './context.mjs';
|
|
9
|
-
export { TRANSITION_VARIANTS } from './transition.mjs';
|
|
10
|
-
import 'clsx';
|
|
11
|
-
import 'react';
|
|
12
|
-
import 'react/jsx-runtime';
|
package/dist/merge-props.d.mts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const mergeProps: <T extends Record<string, any>>(...props: (T | undefined)[]) => T;
|
|
2
|
-
declare const mergeConfigProps: <P extends Record<string, any>, T extends P & {
|
|
3
|
-
props?: (props: Partial<P>) => P;
|
|
4
|
-
omitProps?: string[];
|
|
5
|
-
}>(defaultValues: P, globalConfig: T, props: P) => P;
|
|
6
|
-
|
|
7
|
-
export { mergeConfigProps, mergeProps };
|
package/dist/object.d.mts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const removeAttrsFromObject: <O extends object, A extends keyof O>(object: O, attrs: A[]) => Omit<O, A>;
|
|
2
|
-
declare const extractAttrsFromObject: <O extends object, A extends keyof O>(object: O, attrs: A[]) => Pick<O, A>;
|
|
3
|
-
|
|
4
|
-
export { extractAttrsFromObject, removeAttrsFromObject };
|
package/dist/transition.d.mts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const TRANSITION_VARIANTS: {
|
|
2
|
-
collapse: {
|
|
3
|
-
enter: {
|
|
4
|
-
opacity: number;
|
|
5
|
-
height: string;
|
|
6
|
-
transition: {
|
|
7
|
-
type: "spring";
|
|
8
|
-
duration: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
exit: {
|
|
12
|
-
opacity: number;
|
|
13
|
-
height: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { TRANSITION_VARIANTS };
|
package/dist/tv.d.mts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare const mapPropsVariants: <T extends object, R extends readonly (keyof T)[]>(props: T, variantKeys: R) => [Omit<T, R[number]>, Pick<T, R[number]>];
|
|
2
|
-
declare const radiusBaseVariant: {
|
|
3
|
-
readonly sm: "rounded";
|
|
4
|
-
readonly md: "rounded-md";
|
|
5
|
-
readonly lg: "rounded-lg";
|
|
6
|
-
readonly xl: "rounded-xl";
|
|
7
|
-
readonly "2xl": "rounded-2xl";
|
|
8
|
-
readonly "3xl": "rounded-3xl";
|
|
9
|
-
readonly full: "rounded-full";
|
|
10
|
-
readonly none: "rounded-none";
|
|
11
|
-
};
|
|
12
|
-
declare const radiusVariant: (name: string | string[], group?: string) => {
|
|
13
|
-
sm: {};
|
|
14
|
-
md: {};
|
|
15
|
-
lg: {};
|
|
16
|
-
xl: {};
|
|
17
|
-
"2xl": {};
|
|
18
|
-
"3xl": {};
|
|
19
|
-
full: {};
|
|
20
|
-
none: {};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { mapPropsVariants, radiusBaseVariant, radiusVariant };
|
package/dist/types.d.mts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
3
|
-
type DataAttributes = Record<`data-${string}`, string | boolean | undefined>;
|
|
4
|
-
type UIProps<ElementType extends React.ElementType> = Omit<ComponentPropsWithRef<ElementType>, "className" | "defaultChecked" | "color" | "defaultValue" | "size" | "slot"> & DataAttributes & {
|
|
5
|
-
className?: string;
|
|
6
|
-
render?: React.ReactElement;
|
|
7
|
-
};
|
|
8
|
-
type PropGetter<P = Record<string, unknown>> = (props: P) => P;
|
|
9
|
-
type SlotsToClassNames<S extends string> = {
|
|
10
|
-
[key in S]?: string;
|
|
11
|
-
};
|
|
12
|
-
type SlotsToReactNode<S extends string> = {
|
|
13
|
-
[key in S]?: React.ReactElement<{
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
}>;
|
|
16
|
-
};
|
|
17
|
-
type UnknownTV = () => unknown;
|
|
18
|
-
|
|
19
|
-
export type { DataAttributes, PropGetter, SlotsToClassNames, SlotsToReactNode, UIProps, UnknownTV };
|