mtxuilib 0.1.197 → 0.1.198
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/tools/rag/ui/RagInput.js +1 -1
- package/dist/ui/sheet.d.ts +1 -1
- package/package.json +1 -1
- package/dist/common/devtools/DebugValue.d.ts +0 -5
- package/dist/common/devtools/DebugValue.js +0 -8
- package/dist/common/devtools/DevTools.d.ts +0 -2
- package/dist/common/devtools/DevTools.js +0 -24
- package/dist/providers/MtAppProvider.d.ts +0 -53
- package/dist/providers/MtAppProvider.js +0 -62
- package/dist/styled-system/css/conditions.d.mts +0 -3
- package/dist/styled-system/css/conditions.mjs +0 -30
- package/dist/styled-system/css/css.d.mts +0 -6
- package/dist/styled-system/css/css.mjs +0 -37
- package/dist/styled-system/css/cva.d.mts +0 -14
- package/dist/styled-system/css/cva.mjs +0 -72
- package/dist/styled-system/css/cx.d.mts +0 -1
- package/dist/styled-system/css/cx.mjs +0 -11
- package/dist/styled-system/css/index.d.mts +0 -4
- package/dist/styled-system/css/index.mjs +0 -4
- package/dist/styled-system/css/sva.d.mts +0 -10
- package/dist/styled-system/css/sva.mjs +0 -31
- package/dist/styled-system/helpers.d.mts +0 -39
- package/dist/styled-system/helpers.mjs +0 -248
- package/dist/styled-system/patterns/aspect-ratio.d.mts +0 -5
- package/dist/styled-system/patterns/aspect-ratio.mjs +0 -36
- package/dist/styled-system/patterns/bleed.d.mts +0 -5
- package/dist/styled-system/patterns/bleed.mjs +0 -22
- package/dist/styled-system/patterns/box.d.mts +0 -5
- package/dist/styled-system/patterns/box.mjs +0 -13
- package/dist/styled-system/patterns/center.d.mts +0 -5
- package/dist/styled-system/patterns/center.mjs +0 -19
- package/dist/styled-system/patterns/circle.d.mts +0 -5
- package/dist/styled-system/patterns/circle.mjs +0 -23
- package/dist/styled-system/patterns/container.d.mts +0 -5
- package/dist/styled-system/patterns/container.mjs +0 -19
- package/dist/styled-system/patterns/cq.d.mts +0 -5
- package/dist/styled-system/patterns/cq.mjs +0 -19
- package/dist/styled-system/patterns/divider.d.mts +0 -5
- package/dist/styled-system/patterns/divider.mjs +0 -23
- package/dist/styled-system/patterns/flex.d.mts +0 -5
- package/dist/styled-system/patterns/flex.mjs +0 -24
- package/dist/styled-system/patterns/float.d.mts +0 -5
- package/dist/styled-system/patterns/float.mjs +0 -50
- package/dist/styled-system/patterns/grid-item.d.mts +0 -5
- package/dist/styled-system/patterns/grid-item.mjs +0 -23
- package/dist/styled-system/patterns/grid.d.mts +0 -5
- package/dist/styled-system/patterns/grid.mjs +0 -25
- package/dist/styled-system/patterns/hstack.d.mts +0 -5
- package/dist/styled-system/patterns/hstack.mjs +0 -22
- package/dist/styled-system/patterns/index.d.mts +0 -20
- package/dist/styled-system/patterns/index.mjs +0 -20
- package/dist/styled-system/patterns/link-overlay.d.mts +0 -5
- package/dist/styled-system/patterns/link-overlay.mjs +0 -22
- package/dist/styled-system/patterns/spacer.d.mts +0 -5
- package/dist/styled-system/patterns/spacer.mjs +0 -19
- package/dist/styled-system/patterns/square.d.mts +0 -5
- package/dist/styled-system/patterns/square.mjs +0 -22
- package/dist/styled-system/patterns/stack.d.mts +0 -5
- package/dist/styled-system/patterns/stack.mjs +0 -22
- package/dist/styled-system/patterns/visually-hidden.d.mts +0 -5
- package/dist/styled-system/patterns/visually-hidden.mjs +0 -16
- package/dist/styled-system/patterns/vstack.d.mts +0 -5
- package/dist/styled-system/patterns/vstack.mjs +0 -22
- package/dist/styled-system/patterns/wrap.d.mts +0 -5
- package/dist/styled-system/patterns/wrap.mjs +0 -23
- package/dist/styled-system/tokens/index.d.mts +0 -6
- package/dist/styled-system/tokens/index.mjs +0 -1885
|
@@ -5,9 +5,9 @@ import Textarea from "react-textarea-autosize";
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { EditFormToolbar } from "../../../form/EditFormToolbar";
|
|
7
7
|
import { ZForm, useZodForm } from "../../../form/ZodForm";
|
|
8
|
+
import { Dialog, DialogContent, DialogTrigger } from "../../../ui/dialog";
|
|
8
9
|
import { MtButton } from "../../../ui/mt/Button";
|
|
9
10
|
import { MtInput } from "../../../ui/mt/inputs/input";
|
|
10
|
-
import { Dialog, DialogContent, DialogTrigger } from "../../../ui/dialog";
|
|
11
11
|
import { useRef, useState } from "react";
|
|
12
12
|
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from "../../../ui/form";
|
|
13
13
|
export const RagInputDlg = () => {
|
package/dist/ui/sheet.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
7
7
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
8
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "
|
|
10
|
+
side?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog, DialogContent, DialogTrigger } from "../../ui/dialog";
|
|
4
|
-
import { MtButton } from "../../ui/mt/Button";
|
|
5
|
-
export const DebugValue = (props) => {
|
|
6
|
-
const { title, data, className } = props;
|
|
7
|
-
return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(MtButton, { variant: "outline", className: className, children: title || "debug" }) }), _jsx(DialogContent, { className: "max-h-lvh w-full overflow-scroll bg-red-100", children: _jsx("pre", { className: " text-xs", children: JSON.stringify(data, null, 2) }) })] }));
|
|
8
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import dynamic from "next/dynamic";
|
|
4
|
-
import { useHotkeys } from "react-hotkeys-hook";
|
|
5
|
-
import { useMtapp } from "../../providers/MtAppProvider";
|
|
6
|
-
import { TailwindIndicator } from "../tailwind-indicator";
|
|
7
|
-
const ReactQueryDevtoolsProduction = dynamic(() => import("@tanstack/react-query-devtools/build/modern/production.js").then((d) => ({
|
|
8
|
-
default: d.ReactQueryDevtools,
|
|
9
|
-
})), {
|
|
10
|
-
ssr: false,
|
|
11
|
-
});
|
|
12
|
-
export const HOTKEY_Debug = "alt+.";
|
|
13
|
-
export const DevTools = () => {
|
|
14
|
-
const debug = useMtapp((x) => x.debug);
|
|
15
|
-
const setDebug = useMtapp((x) => x.setDebug);
|
|
16
|
-
useHotkeys(HOTKEY_Debug, () => {
|
|
17
|
-
console.log("debug2:%o", !debug);
|
|
18
|
-
setDebug(!debug);
|
|
19
|
-
}, [debug, setDebug]);
|
|
20
|
-
if (!debug) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsx(ReactQueryDevtoolsProduction, { buttonPosition: "bottom-right" }), _jsx(TailwindIndicator, {})] }));
|
|
24
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { type StateCreator } from "zustand";
|
|
2
|
-
export interface AppSliceProps {
|
|
3
|
-
debug?: boolean;
|
|
4
|
-
listviewLayout?: string;
|
|
5
|
-
cacheEnabled?: boolean;
|
|
6
|
-
layout?: string;
|
|
7
|
-
theme?: string;
|
|
8
|
-
openDebug?: boolean;
|
|
9
|
-
openFab?: boolean;
|
|
10
|
-
url?: string;
|
|
11
|
-
hostname: string;
|
|
12
|
-
}
|
|
13
|
-
export interface AppSliceState extends AppSliceProps {
|
|
14
|
-
_hasHydrated?: boolean;
|
|
15
|
-
setHasHydrated: (_hasHydrated: boolean) => void;
|
|
16
|
-
setDebug: (debug: boolean) => void;
|
|
17
|
-
setLayout: (layout: string) => void;
|
|
18
|
-
setOpenDebug: (openDebug: boolean) => void;
|
|
19
|
-
setCacheEnabled: (cacheEnabled: boolean) => void;
|
|
20
|
-
setOpenFab: (openFab: boolean) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const createAppSlice: StateCreator<AppSliceState, [
|
|
23
|
-
], [
|
|
24
|
-
], AppSliceState>;
|
|
25
|
-
type mtappState = AppSliceState;
|
|
26
|
-
export declare const gomtmContext: import("react").Context<(Omit<Omit<Omit<import("zustand").StoreApi<AppSliceState>, "persist"> & {
|
|
27
|
-
persist: {
|
|
28
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AppSliceState, {
|
|
29
|
-
[k: string]: unknown;
|
|
30
|
-
}>>) => void;
|
|
31
|
-
clearStorage: () => void;
|
|
32
|
-
rehydrate: () => Promise<void> | void;
|
|
33
|
-
hasHydrated: () => boolean;
|
|
34
|
-
onHydrate: (fn: (state: AppSliceState) => void) => () => void;
|
|
35
|
-
onFinishHydration: (fn: (state: AppSliceState) => void) => () => void;
|
|
36
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AppSliceState, {
|
|
37
|
-
[k: string]: unknown;
|
|
38
|
-
}>>;
|
|
39
|
-
};
|
|
40
|
-
}, "setState"> & {
|
|
41
|
-
setState<A extends string | {
|
|
42
|
-
type: string;
|
|
43
|
-
}>(partial: AppSliceState | Partial<AppSliceState> | ((state: AppSliceState) => AppSliceState | Partial<AppSliceState>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
44
|
-
}, "setState"> & {
|
|
45
|
-
setState(nextStateOrUpdater: AppSliceState | Partial<AppSliceState> | ((state: import("immer").WritableDraft<AppSliceState>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
46
|
-
type: string;
|
|
47
|
-
} | undefined): void;
|
|
48
|
-
}) | null>;
|
|
49
|
-
type AppProviderProps = React.PropsWithChildren<AppSliceProps>;
|
|
50
|
-
export declare const MtAppProvider: (props: AppProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
export declare function useMtapp(): mtappState;
|
|
52
|
-
export declare function useMtapp<T>(selector: (state: mtappState) => T): T;
|
|
53
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useMemo } from "react";
|
|
4
|
-
import { createStore, useStore } from "zustand";
|
|
5
|
-
import { devtools, persist } from "zustand/middleware";
|
|
6
|
-
import { immer } from "zustand/middleware/immer";
|
|
7
|
-
import { useShallow } from "zustand/react/shallow";
|
|
8
|
-
export const createAppSlice = (set, get, init) => ({
|
|
9
|
-
debug: false,
|
|
10
|
-
commands: {},
|
|
11
|
-
hostname: "",
|
|
12
|
-
...init,
|
|
13
|
-
setHasHydrated: (_hasHydrated) => set({ _hasHydrated }),
|
|
14
|
-
setDebug: (debug) => set({ debug }),
|
|
15
|
-
setLayout: (layout) => set({ layout }),
|
|
16
|
-
setCacheEnabled: (cacheEnabled) => set({ cacheEnabled }),
|
|
17
|
-
openDebug: false,
|
|
18
|
-
setOpenDebug: (openDebug) => set({ openDebug }),
|
|
19
|
-
setOpenFab: (openFab) => set({ openFab }),
|
|
20
|
-
});
|
|
21
|
-
const createMtAppStore = (initProps) => {
|
|
22
|
-
return createStore()(persist(devtools(immer((...a) => ({
|
|
23
|
-
...createAppSlice(...a),
|
|
24
|
-
...initProps,
|
|
25
|
-
})), {
|
|
26
|
-
name: "mtapp",
|
|
27
|
-
}), {
|
|
28
|
-
name: "mtapp",
|
|
29
|
-
skipHydration: true,
|
|
30
|
-
version: 1,
|
|
31
|
-
onRehydrateStorage: () => (state, error) => {
|
|
32
|
-
state?.setHasHydrated(true);
|
|
33
|
-
},
|
|
34
|
-
partialize: (state) => {
|
|
35
|
-
return Object.fromEntries(Object.entries(state).filter(([key]) => {
|
|
36
|
-
return ![
|
|
37
|
-
"cookieStr",
|
|
38
|
-
"children",
|
|
39
|
-
"openFab",
|
|
40
|
-
"userInfo",
|
|
41
|
-
"_hasHydrated",
|
|
42
|
-
].includes(key);
|
|
43
|
-
}));
|
|
44
|
-
},
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
export const gomtmContext = createContext(null);
|
|
48
|
-
export const MtAppProvider = (props) => {
|
|
49
|
-
const { children, ...etc } = props;
|
|
50
|
-
const mystore = useMemo(() => createMtAppStore(etc), [etc]);
|
|
51
|
-
return (_jsx(gomtmContext.Provider, { value: mystore, children: children }));
|
|
52
|
-
};
|
|
53
|
-
const DEFAULT_USE_SHALLOW = true;
|
|
54
|
-
export function useMtapp(selector) {
|
|
55
|
-
const store = useContext(gomtmContext);
|
|
56
|
-
if (!store)
|
|
57
|
-
throw new Error("useMtapp must in MtAppProvider");
|
|
58
|
-
if (selector) {
|
|
59
|
-
return useStore(store, DEFAULT_USE_SHALLOW ? useShallow(selector) : selector);
|
|
60
|
-
}
|
|
61
|
-
return useStore(store);
|
|
62
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { withoutSpace } from '../helpers.mjs';
|
|
2
|
-
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,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base";
|
|
3
|
-
const conditions = new Set(conditionsStr.split(','));
|
|
4
|
-
export function isCondition(value) {
|
|
5
|
-
return conditions.has(value) || /^@|&|&$/.test(value);
|
|
6
|
-
}
|
|
7
|
-
const underscoreRegex = /^_/;
|
|
8
|
-
const conditionsSelectorRegex = /&|@/;
|
|
9
|
-
export function finalizeConditions(paths) {
|
|
10
|
-
return paths.map((path) => {
|
|
11
|
-
if (conditions.has(path)) {
|
|
12
|
-
return path.replace(underscoreRegex, '');
|
|
13
|
-
}
|
|
14
|
-
if (conditionsSelectorRegex.test(path)) {
|
|
15
|
-
return `[${withoutSpace(path.trim())}]`;
|
|
16
|
-
}
|
|
17
|
-
return path;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export function sortConditions(paths) {
|
|
21
|
-
return paths.sort((a, b) => {
|
|
22
|
-
const aa = isCondition(a);
|
|
23
|
-
const bb = isCondition(b);
|
|
24
|
-
if (aa && !bb)
|
|
25
|
-
return 1;
|
|
26
|
-
if (!aa && bb)
|
|
27
|
-
return -1;
|
|
28
|
-
return 0;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.mjs';
|
|
2
|
-
import { sortConditions, finalizeConditions } from './conditions.mjs';
|
|
3
|
-
const utilities = "aspectRatio:aspect,boxDecorationBreak:decoration,zIndex:z,boxSizing:box,objectPosition:obj-pos,objectFit:obj-fit,overscrollBehavior:overscroll,overscrollBehaviorX:overscroll-x,overscrollBehaviorY:overscroll-y,position:pos/1,top:top,left:left,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,inset:inset,insetBlockEnd:inset-b,insetBlockStart:inset-t,insetInlineEnd:end/insetEnd/1,insetInlineStart:start/insetStart/1,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:basis,flex:flex,flexDirection:flex/flexDir,flexGrow:grow,flexShrink:shrink,gridTemplateColumns:grid-cols,gridTemplateRows:grid-rows,gridColumn:col-span,gridRow:row-span,gridColumnStart:col-start,gridColumnEnd:col-end,gridAutoFlow:grid-flow,gridAutoColumns:auto-cols,gridAutoRows:auto-rows,gap:gap,gridGap:gap,gridRowGap:gap-x,gridColumnGap:gap-y,rowGap:gap-x,columnGap:gap-y,justifyContent:justify,alignContent:content,alignItems:items,alignSelf:self,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pb,paddingBlockStart:pt,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mb,marginBlockStart:mt,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:space-x,spaceY:space-y,outlineWidth:ring-width/ringWidth,outlineColor:ring-color/ringColor,outline:ring/1,outlineOffset:ring-offset/ringOffset,divideX:divide-x,divideY:divide-y,divideColor:divide-color,divideStyle:divide-style,width:w/1,inlineSize:w,minWidth:min-w/minW,minInlineSize:min-w,maxWidth:max-w/maxW,maxInlineSize:max-w,height:h/1,blockSize:h,minHeight:min-h/minH,minBlockSize:min-h,maxHeight:max-h/maxH,maxBlockSize:max-b,color:text,fontFamily:font,fontSize:fs,fontWeight:fw,fontSmoothing:smoothing,fontVariantNumeric:numeric,letterSpacing:tracking,lineHeight:leading,textAlign:text-align,textDecoration:text-decor,textDecorationColor:text-decor-color,textEmphasisColor:text-emphasis-color,textDecorationStyle:decoration-style,textDecorationThickness:decoration-thickness,textUnderlineOffset:underline-offset,textTransform:text-transform,textIndent:indent,textShadow:text-shadow,textShadowColor:text-shadow/textShadowColor,textOverflow:text-overflow,verticalAlign:v-align,wordBreak:break,textWrap:text-wrap,truncate:truncate,lineClamp:clamp,listStyleType:list-type,listStylePosition:list-pos,listStyleImage:list-img,backgroundPosition:bg-pos/bgPosition,backgroundPositionX:bg-pos-x/bgPositionX,backgroundPositionY:bg-pos-y/bgPositionY,backgroundAttachment:bg-attach/bgAttachment,backgroundClip:bg-clip/bgClip,background:bg/1,backgroundColor:bg/bgColor,backgroundOrigin:bg-origin/bgOrigin,backgroundImage:bg-img/bgImage,backgroundRepeat:bg-repeat/bgRepeat,backgroundBlendMode:bg-blend/bgBlendMode,backgroundSize:bg-size/bgSize,backgroundGradient:bg-gradient/bgGradient,textGradient:text-gradient,gradientFromPosition:gradient-from-pos,gradientToPosition:gradient-to-pos,gradientFrom:gradient-from,gradientTo:gradient-to,gradientVia:gradient-via,gradientViaPosition:gradient-via-pos,borderRadius:rounded/1,borderTopLeftRadius:rounded-tl/roundedTopLeft,borderTopRightRadius:rounded-tr/roundedTopRight,borderBottomRightRadius:rounded-br/roundedBottomRight,borderBottomLeftRadius:rounded-bl/roundedBottomLeft,borderTopRadius:rounded-t/roundedTop,borderRightRadius:rounded-r/roundedRight,borderBottomRadius:rounded-b/roundedBottom,borderLeftRadius:rounded-l/roundedLeft,borderStartStartRadius:rounded-ss/roundedStartStart,borderStartEndRadius:rounded-se/roundedStartEnd,borderStartRadius:rounded-s/roundedStart,borderEndStartRadius:rounded-es/roundedEndStart,borderEndEndRadius:rounded-ee/roundedEndEnd,borderEndRadius:rounded-e/roundedEnd,border:border,borderWidth:border-w,borderTopWidth:border-tw,borderLeftWidth:border-lw,borderRightWidth:border-rw,borderBottomWidth:border-bw,borderColor:border,borderInline:border-x/borderX,borderInlineWidth:border-x/borderXWidth,borderInlineColor:border-x/borderXColor,borderBlock:border-y/borderY,borderBlockWidth:border-y/borderYWidth,borderBlockColor:border-y/borderYColor,borderLeft:border-l,borderLeftColor:border-l,borderInlineStart:border-s/borderStart,borderInlineStartWidth:border-s/borderStartWidth,borderInlineStartColor:border-s/borderStartColor,borderRight:border-r,borderRightColor:border-r,borderInlineEnd:border-e/borderEnd,borderInlineEndWidth:border-e/borderEndWidth,borderInlineEndColor:border-e/borderEndColor,borderTop:border-t,borderTopColor:border-t,borderBottom:border-b,borderBottomColor:border-b,borderBlockEnd:border-be,borderBlockEndColor:border-be,borderBlockStart:border-bs,borderBlockStartColor:border-bs,boxShadow:shadow/1,boxShadowColor:shadow-color/shadowColor,mixBlendMode:mix-blend,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:backdrop,backdropBlur:backdrop-blur,backdropBrightness:backdrop-brightness,backdropContrast:backdrop-contrast,backdropGrayscale:backdrop-grayscale,backdropHueRotate:backdrop-hue-rotate,backdropInvert:backdrop-invert,backdropOpacity:backdrop-opacity,backdropSaturate:backdrop-saturate,backdropSepia:backdrop-sepia,borderCollapse:border,borderSpacing:border-spacing,borderSpacingX:border-spacing-x,borderSpacingY:border-spacing-y,tableLayout:table,transitionTimingFunction:ease,transitionDelay:delay,transitionDuration:duration,transitionProperty:transition-prop,transition:transition,animation:animation,animationName:animation-name,animationTimingFunction:animation-ease,animationDuration:animation-duration,animationDelay:animation-delay,transformOrigin:origin,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:accent,caretColor:caret,scrollBehavior:scroll,scrollbar:scrollbar,scrollMargin:scroll-m,scrollMarginLeft:scroll-ml,scrollMarginRight:scroll-mr,scrollMarginTop:scroll-mt,scrollMarginBottom:scroll-mb,scrollMarginBlock:scroll-my/scrollMarginY,scrollMarginBlockEnd:scroll-mb,scrollMarginBlockStart:scroll-mt,scrollMarginInline:scroll-mx/scrollMarginX,scrollMarginInlineEnd:scroll-me,scrollMarginInlineStart:scroll-ms,scrollPadding:scroll-p,scrollPaddingBlock:scroll-pb/scrollPaddingY,scrollPaddingBlockStart:scroll-pt,scrollPaddingBlockEnd:scroll-pb,scrollPaddingInline:scroll-px/scrollPaddingX,scrollPaddingInlineEnd:scroll-pe,scrollPaddingInlineStart:scroll-ps,scrollPaddingLeft:scroll-pl,scrollPaddingRight:scroll-pr,scrollPaddingTop:scroll-pt,scrollPaddingBottom:scroll-pb,scrollSnapAlign:snap-align,scrollSnapStop:snap-stop,scrollSnapType:snap-type,scrollSnapStrictness:snap-strictness,scrollSnapMargin:snap-m,scrollSnapMarginTop:snap-mt,scrollSnapMarginBottom:snap-mb,scrollSnapMarginLeft:snap-ml,scrollSnapMarginRight:snap-mr,touchAction:touch,userSelect:select,fill:fill,stroke:stroke,strokeWidth:stroke-w,srOnly:sr,debug:debug,appearance:appearance,backfaceVisibility:backface,clipPath:clip-path,hyphens:hyphens,mask:mask,maskImage:mask-image,maskSize:mask-size,textSizeAdjust:text-adjust,container:cq,containerName:cq-name,containerType:cq-type,textStyle:textStyle";
|
|
4
|
-
const classNameByProp = new Map();
|
|
5
|
-
const shorthands = new Map();
|
|
6
|
-
utilities.split(',').forEach((utility) => {
|
|
7
|
-
const [prop, meta] = utility.split(':');
|
|
8
|
-
const [className, ...shorthandList] = meta.split('/');
|
|
9
|
-
classNameByProp.set(prop, className);
|
|
10
|
-
if (shorthandList.length) {
|
|
11
|
-
shorthandList.forEach((shorthand) => {
|
|
12
|
-
shorthands.set(shorthand === '1' ? className : shorthand, prop);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
const resolveShorthand = (prop) => shorthands.get(prop) || prop;
|
|
17
|
-
const context = {
|
|
18
|
-
conditions: {
|
|
19
|
-
shift: sortConditions,
|
|
20
|
-
finalize: finalizeConditions,
|
|
21
|
-
breakpoints: { keys: ["base", "sm", "md", "lg", "xl", "2xl"] }
|
|
22
|
-
},
|
|
23
|
-
utility: {
|
|
24
|
-
transform: (prop, value) => {
|
|
25
|
-
const key = resolveShorthand(prop);
|
|
26
|
-
const propKey = classNameByProp.get(key) || hypenateProperty(key);
|
|
27
|
-
return { className: `${propKey}_${withoutSpace(value)}` };
|
|
28
|
-
},
|
|
29
|
-
hasShorthand: true,
|
|
30
|
-
toHash: (path, hashFn) => hashFn(path.join(":")),
|
|
31
|
-
resolveShorthand: resolveShorthand,
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const cssFn = createCss(context);
|
|
35
|
-
export const css = (...styles) => cssFn(mergeCss(...styles));
|
|
36
|
-
css.raw = (...styles) => mergeCss(...styles);
|
|
37
|
-
export const { mergeCss, assignCss } = createMergeCss(context);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function cva(config: any): ((...args: any[]) => any) & {
|
|
2
|
-
__cva__: boolean;
|
|
3
|
-
variantMap: {
|
|
4
|
-
[k: string]: string[];
|
|
5
|
-
};
|
|
6
|
-
variantKeys: string[];
|
|
7
|
-
raw: (props?: {}) => any;
|
|
8
|
-
config: any;
|
|
9
|
-
merge: (__cva: any) => ((...args: any[]) => any) & any;
|
|
10
|
-
splitVariantProps: (props: any) => {}[];
|
|
11
|
-
getVariantProps: (variants: any) => any;
|
|
12
|
-
};
|
|
13
|
-
export function getCompoundVariantCss(compoundVariants: any, variantMap: any): {};
|
|
14
|
-
export function assertCompoundVariant(name: any, compoundVariants: any, variants: any, prop: any): void;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { compact, mergeProps, memo, splitProps, uniq } from '../helpers.mjs';
|
|
2
|
-
import { css, mergeCss } from './css.mjs';
|
|
3
|
-
const defaults = (conf) => ({
|
|
4
|
-
base: {},
|
|
5
|
-
variants: {},
|
|
6
|
-
defaultVariants: {},
|
|
7
|
-
compoundVariants: [],
|
|
8
|
-
...conf,
|
|
9
|
-
});
|
|
10
|
-
export function cva(config) {
|
|
11
|
-
const { base, variants, defaultVariants, compoundVariants } = defaults(config);
|
|
12
|
-
const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) });
|
|
13
|
-
function resolve(props = {}) {
|
|
14
|
-
const computedVariants = getVariantProps(props);
|
|
15
|
-
let variantCss = { ...base };
|
|
16
|
-
for (const [key, value] of Object.entries(computedVariants)) {
|
|
17
|
-
if (variants[key]?.[value]) {
|
|
18
|
-
variantCss = mergeCss(variantCss, variants[key][value]);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants);
|
|
22
|
-
return mergeCss(variantCss, compoundVariantCss);
|
|
23
|
-
}
|
|
24
|
-
function merge(__cva) {
|
|
25
|
-
const override = defaults(__cva.config);
|
|
26
|
-
const variantKeys = uniq(__cva.variantKeys, Object.keys(variants));
|
|
27
|
-
return cva({
|
|
28
|
-
base: mergeCss(base, override.base),
|
|
29
|
-
variants: Object.fromEntries(variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])])),
|
|
30
|
-
defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
|
|
31
|
-
compoundVariants: [...compoundVariants, ...override.compoundVariants],
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function cvaFn(props) {
|
|
35
|
-
return css(resolve(props));
|
|
36
|
-
}
|
|
37
|
-
const variantKeys = Object.keys(variants);
|
|
38
|
-
function splitVariantProps(props) {
|
|
39
|
-
return splitProps(props, variantKeys);
|
|
40
|
-
}
|
|
41
|
-
const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]));
|
|
42
|
-
return Object.assign(memo(cvaFn), {
|
|
43
|
-
__cva__: true,
|
|
44
|
-
variantMap,
|
|
45
|
-
variantKeys,
|
|
46
|
-
raw: resolve,
|
|
47
|
-
config,
|
|
48
|
-
merge,
|
|
49
|
-
splitVariantProps,
|
|
50
|
-
getVariantProps
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
export function getCompoundVariantCss(compoundVariants, variantMap) {
|
|
54
|
-
let result = {};
|
|
55
|
-
compoundVariants.forEach((compoundVariant) => {
|
|
56
|
-
const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
|
|
57
|
-
if (key === 'css')
|
|
58
|
-
return true;
|
|
59
|
-
const values = Array.isArray(value) ? value : [value];
|
|
60
|
-
return values.some((value) => variantMap[key] === value);
|
|
61
|
-
});
|
|
62
|
-
if (isMatching) {
|
|
63
|
-
result = mergeCss(result, compoundVariant.css);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
export function assertCompoundVariant(name, compoundVariants, variants, prop) {
|
|
69
|
-
if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
|
|
70
|
-
throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function cx(...args: any[]): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function sva(config: any): ((...args: any[]) => any) & {
|
|
2
|
-
__cva__: boolean;
|
|
3
|
-
raw: (props: any) => any;
|
|
4
|
-
variantMap: {
|
|
5
|
-
[k: string]: string[];
|
|
6
|
-
};
|
|
7
|
-
variantKeys: string[];
|
|
8
|
-
splitVariantProps: (props: any) => {}[];
|
|
9
|
-
getVariantProps: (variants: any) => any;
|
|
10
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { compact, getSlotRecipes, memo, splitProps } from '../helpers.mjs';
|
|
2
|
-
import { cva } from './cva.mjs';
|
|
3
|
-
import { cx } from './cx.mjs';
|
|
4
|
-
const slotClass = (className, slot) => className + '__' + slot;
|
|
5
|
-
export function sva(config) {
|
|
6
|
-
const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)]);
|
|
7
|
-
const defaultVariants = config.defaultVariants ?? {};
|
|
8
|
-
function svaFn(props) {
|
|
9
|
-
const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), config.className && slotClass(config.className, slot))]);
|
|
10
|
-
return Object.fromEntries(result);
|
|
11
|
-
}
|
|
12
|
-
function raw(props) {
|
|
13
|
-
const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)]);
|
|
14
|
-
return Object.fromEntries(result);
|
|
15
|
-
}
|
|
16
|
-
const variants = config.variants ?? {};
|
|
17
|
-
const variantKeys = Object.keys(variants);
|
|
18
|
-
function splitVariantProps(props) {
|
|
19
|
-
return splitProps(props, variantKeys);
|
|
20
|
-
}
|
|
21
|
-
const getVariantProps = (variants) => ({ ...(defaultVariants || {}), ...compact(variants) });
|
|
22
|
-
const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]));
|
|
23
|
-
return Object.assign(memo(svaFn), {
|
|
24
|
-
__cva__: false,
|
|
25
|
-
raw,
|
|
26
|
-
variantMap,
|
|
27
|
-
variantKeys,
|
|
28
|
-
splitVariantProps,
|
|
29
|
-
getVariantProps,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export function __spreadValues(a: any, b: any): any;
|
|
2
|
-
export function __objRest(source: any, exclude: any): {
|
|
3
|
-
[k: string]: any;
|
|
4
|
-
};
|
|
5
|
-
export function compact(value: any): {
|
|
6
|
-
[k: string]: any;
|
|
7
|
-
};
|
|
8
|
-
export function createCss(context: any): (...args: any[]) => any;
|
|
9
|
-
export function createMergeCss(context: any): {
|
|
10
|
-
mergeCss: (...args: any[]) => any;
|
|
11
|
-
assignCss: (...styles: any[]) => any;
|
|
12
|
-
};
|
|
13
|
-
export function filterBaseConditions(c: any): any;
|
|
14
|
-
export function getPatternStyles(pattern: any, styles: any): any;
|
|
15
|
-
export function getSlotCompoundVariant(compoundVariants: any, slotName: any): any;
|
|
16
|
-
export function getSlotRecipes(recipe?: {}): {
|
|
17
|
-
[k: string]: any;
|
|
18
|
-
};
|
|
19
|
-
export function hypenateProperty(...args: any[]): any;
|
|
20
|
-
export function isBaseCondition(v: any): boolean;
|
|
21
|
-
export function isObject(value: any): boolean;
|
|
22
|
-
export function mapObject(obj: any, fn: any): any;
|
|
23
|
-
export function memo(fn: any): (...args: any[]) => any;
|
|
24
|
-
export function mergeProps(...sources: any[]): any;
|
|
25
|
-
export namespace patternFns {
|
|
26
|
-
export { mapObject as map };
|
|
27
|
-
export { isCssFunction };
|
|
28
|
-
export { isCssVar };
|
|
29
|
-
export { isCssUnit };
|
|
30
|
-
}
|
|
31
|
-
export function splitProps(props: any, ...keys: any[]): {}[];
|
|
32
|
-
export function toHash(value: any): string;
|
|
33
|
-
export function uniq(...items: any[]): any;
|
|
34
|
-
export function walkObject(target: any, predicate: any, options?: {}): any;
|
|
35
|
-
export function withoutSpace(str: any): any;
|
|
36
|
-
declare function isCssFunction(v: any): boolean;
|
|
37
|
-
declare function isCssVar(v: any): boolean;
|
|
38
|
-
declare function isCssUnit(v: any): boolean;
|
|
39
|
-
export {};
|