@jamsrui/utils 0.0.19 → 0.1.0
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/README.md +1 -3
- package/dist/attr.d.mts +1 -2
- package/dist/attr.mjs +1 -1
- package/dist/cn.mjs +1 -1
- package/dist/index.d.mts +3 -7
- package/dist/index.mjs +1 -1
- package/dist/tv.d.mts +1 -21
- package/dist/tv.mjs +1 -1
- package/dist/types.d.mts +1 -10
- package/package.json +1 -1
- package/dist/class-names.d.mts +0 -60
- package/dist/class-names.mjs +0 -1
- package/dist/context.d.mts +0 -10
- package/dist/context.mjs +0 -1
package/README.md
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**A comprehensive React UI component library designed for developers, with Tailwind CSS integration for seamless styling.**
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
## 📖 **Overview**
|
|
7
6
|
|
|
8
7
|
[JamsrUI](https://jamsr-ui.jamsrworld.com) is designed to help developers build modern, fast and visually appealing web applications with ease.
|
|
9
8
|
|
|
10
|
-
## 🚀 Getting Started
|
|
9
|
+
## 🚀 Getting Started
|
|
11
10
|
|
|
12
11
|
Boost & Build your websites using [JamsrUI](https://jamsr-ui.jamsrworld.com).
|
|
13
12
|
|
|
@@ -37,4 +36,3 @@ We welcome contributions from developers of all skill levels!
|
|
|
37
36
|
## ⭐ Support the Project
|
|
38
37
|
|
|
39
38
|
If you find **JamsrUI** helpful, consider giving it a ⭐ on [GitHub](https://github.com/jamsrworld/jamsr-ui).
|
|
40
|
-
|
package/dist/attr.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
declare const dataAttrDev: (value: string) => string | undefined;
|
|
2
1
|
declare const isDisabledElement: (element: HTMLElement) => boolean;
|
|
3
2
|
type Booleanish = boolean | "true" | "false";
|
|
4
3
|
declare const dataAttr: (condition: boolean | undefined) => Booleanish;
|
|
5
4
|
|
|
6
|
-
export { dataAttr,
|
|
5
|
+
export { dataAttr, isDisabledElement };
|
package/dist/attr.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=t=>
|
|
1
|
+
const e=t=>t.getAttribute("disabled")!==null||t.getAttribute("aria-disabled")!==null||t.getAttribute("data-disabled")!==null,a=t=>t?"true":void 0;export{a as dataAttr,e as isDisabledElement};
|
package/dist/cn.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"clsx";import{extendTailwindMerge as e}from"tailwind-merge";const o=e({}),m=(...r)=>o(t(r));export{m as cn};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { dataAttr, dataAttrDev, isDisabledElement } from './attr.mjs';
|
|
1
|
+
export { dataAttr, isDisabledElement } from './attr.mjs';
|
|
3
2
|
export { cn } from './cn.mjs';
|
|
4
3
|
export { mergeConfigProps, mergeProps } from './merge-props.mjs';
|
|
5
|
-
export { mapPropsVariants
|
|
6
|
-
export { PropGetter,
|
|
7
|
-
export { absoluteFullClasses, allColors, allVariants, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, ringClasses, translateCenterClasses } from './class-names.mjs';
|
|
8
|
-
export { createConfigContext } from './context.mjs';
|
|
4
|
+
export { mapPropsVariants } from './tv.mjs';
|
|
5
|
+
export { PropGetter, UIProps } from './types.mjs';
|
|
9
6
|
export { TRANSITION_VARIANTS } from './transition.mjs';
|
|
10
7
|
import 'clsx';
|
|
11
8
|
import 'react';
|
|
12
|
-
import 'react/jsx-runtime';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dataAttr as e,isDisabledElement as t}from"./attr.mjs";import{cn as m}from"./cn.mjs";import{mergeConfigProps as f,mergeProps as a}from"./merge-props.mjs";import{mapPropsVariants as P}from"./tv.mjs";import{TRANSITION_VARIANTS as n}from"./transition.mjs";export{n as TRANSITION_VARIANTS,m as cn,e as dataAttr,t as isDisabledElement,P as mapPropsVariants,f as mergeConfigProps,a as mergeProps};
|
package/dist/tv.d.mts
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
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
2
|
|
|
23
|
-
export { mapPropsVariants
|
|
3
|
+
export { mapPropsVariants };
|
package/dist/tv.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeAttrsFromObject as
|
|
1
|
+
import{removeAttrsFromObject as n}from"./object.mjs";const s=(e,o)=>{const m=n(e,[...o]),t={};return o.forEach(r=>{r in e&&(t[r]=e[r])}),[m,t]};export{s as mapPropsVariants};
|
package/dist/types.d.mts
CHANGED
|
@@ -6,14 +6,5 @@ type UIProps<ElementType extends React.ElementType> = Omit<ComponentPropsWithRef
|
|
|
6
6
|
render?: React.ReactElement;
|
|
7
7
|
};
|
|
8
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
9
|
|
|
19
|
-
export type { DataAttributes, PropGetter,
|
|
10
|
+
export type { DataAttributes, PropGetter, UIProps };
|
package/package.json
CHANGED
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/class-names.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={default:"bg-default border-default text-default-foreground data-hover:bg-default-hover data-pressed:bg-default-active",primary:"bg-primary border-primary text-primary-foreground data-hover:bg-primary-hover data-pressed:bg-primary-active",secondary:"bg-secondary border-secondary text-secondary-foreground data-hover:bg-secondary-hover data-pressed:bg-secondary-active",success:"bg-success border-success text-success-foreground data-hover:bg-success-hover data-pressed:bg-success-active",warning:"bg-warning border-warning text-warning-foreground data-hover:bg-warning-hover data-pressed:bg-warning-active",danger:"bg-danger border-danger text-danger-foreground data-hover:bg-danger-hover data-pressed:bg-danger-active"},a={default:"bg-transparent border-default text-foreground data-hover:bg-default-flat data-pressed:bg-default-flat-active",primary:"bg-transparent border-primary text-primary data-hover:bg-primary-flat data-pressed:bg-primary-flat-active",secondary:"bg-transparent border-secondary text-secondary data-hover:bg-secondary-flat data-pressed:bg-secondary-flat-active",success:"bg-transparent border-success text-success data-hover:bg-success-flat data-pressed:bg-success-flat-active",warning:"bg-transparent border-warning text-warning data-hover:bg-warning-flat data-pressed:bg-warning-flat-active",danger:"bg-transparent border-danger text-danger data-hover:bg-danger-flat data-pressed:bg-danger-flat-active"},r={default:"text-foreground data-hover:opacity-90",primary:"text-primary data-hover:text-primary-hover",secondary:"text-secondary data-hover:text-secondary-hover",success:"text-success data-hover:text-success-hover",warning:"text-warning data-hover:text-warning-hover",danger:"text-danger data-hover:text-danger-hover"},t={default:"bg-transparent text-foreground data-hover:bg-default-flat-hover data-pressed:bg-foreground-flat-active",primary:"bg-transparent text-primary data-hover:bg-primary-flat-hover data-pressed:bg-primary-flat-active",secondary:"bg-transparent text-secondary data-hover:bg-secondary-flat-hover data-pressed:bg-secondary-flat-active",success:"bg-transparent text-success data-hover:bg-success-flat-hover data-pressed:bg-success-flat-active",warning:"bg-transparent text-warning data-hover:bg-warning-flat-hover data-pressed:bg-warning-flat-active",danger:"bg-transparent text-danger data-hover:bg-danger-flat-hover data-pressed:bg-danger-flat-active"},s={default:"bg-default-flat-hover text-foreground data-hover:bg-default-flat data-pressed:bg-default-flat-active",primary:"bg-primary-flat-hover text-primary data-hover:bg-primary-flat data-pressed:bg-primary-flat-active",secondary:"bg-secondary-flat-hover text-secondary data-hover:bg-secondary-flat data-pressed:bg-secondary-flat-active",success:"bg-success-flat-hover text-success data-hover:bg-success-flat data-pressed:bg-success-flat-active",warning:"bg-warning-flat-hover text-warning data-hover:bg-warning-flat data-pressed:bg-warning-flat-active",danger:"bg-danger-flat-hover text-danger data-hover:bg-danger-flat data-pressed:bg-danger-flat-active"},o={solid:e,bordered:a,text:r,light:t,flat:s},d=["default","primary","secondary","success","warning","danger"],n=["solid","bordered","text","light","flat"],i=["focus-visible:outline-solid","focus-visible:z-10","focus-visible:outline-2","focus-visible:outline-focus","focus-visible:outline-offset-2"],g=["outline-none","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-solid","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],c=["outline-none","uig-focus-visible:z-10","uig-focus-visible:ring-2","uig-focus-visible:ring-focus","uig-focus-visible:ring-offset-2","uig-focus-visible:ring-offset-background"],l=["outline-none","ring-2","ring-focus","ring-offset-2","ring-offset-background"],f=["absolute","top-1/2","left-1/2","-translate-x-1/2","-translate-y-1/2"],b=["absolute","inset-0"];export{b as absoluteFullClasses,d as allColors,n as allVariants,o as colorVariants,g as dataFocusVisibleClasses,i as focusVisibleClasses,c as groupDataFocusVisibleClasses,l as ringClasses,f as translateCenterClasses};
|
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/context.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as p}from"react/jsx-runtime";import{createContext as g,use as m}from"react";import{mergeProps as l}from"./merge-props.mjs";const P=({displayName:t})=>{const e=g({});e.displayName=t;const n=()=>m(e);return[r=>{const{merge:s=!0,...o}=r,i=n(),a=s?l(i,o):o,{children:c,...d}=a;return p(e,{value:d,children:c})},n]};export{P as createConfigContext};
|