@tuuject/koi-react 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +73 -2
- package/dist/alert/Alert.d.ts +13 -0
- package/dist/alert/Alert.js +16 -0
- package/dist/avatar/Avatar.d.ts +7 -0
- package/dist/avatar/Avatar.js +10 -0
- package/dist/badge/Badge.d.ts +7 -0
- package/dist/badge/Badge.js +8 -0
- package/dist/button/Button.d.ts +22 -0
- package/dist/button/Button.js +28 -0
- package/dist/card/Card.d.ts +9 -0
- package/dist/card/Card.js +8 -0
- package/dist/chat-bubble/ChatBubble.d.ts +7 -0
- package/dist/chat-bubble/ChatBubble.js +7 -0
- package/dist/checkbox/Checkbox.d.ts +18 -0
- package/dist/checkbox/Checkbox.js +25 -0
- package/dist/dialog/Dialog.d.ts +13 -0
- package/dist/dialog/Dialog.js +38 -0
- package/dist/divider/Divider.d.ts +6 -0
- package/dist/divider/Divider.js +17 -0
- package/dist/field/Field.d.ts +14 -0
- package/dist/field/Field.js +19 -0
- package/dist/field/context.d.ts +5 -0
- package/dist/field/context.js +2 -0
- package/dist/icons.d.ts +26 -0
- package/dist/icons.js +46 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +30 -0
- package/dist/input/Input.d.ts +9 -0
- package/dist/input/Input.js +15 -0
- package/dist/link/Link.d.ts +11 -0
- package/dist/link/Link.js +17 -0
- package/dist/pagination/Pagination.d.ts +7 -0
- package/dist/pagination/Pagination.js +26 -0
- package/dist/panda/buildinfo.json +10442 -0
- package/dist/panda/lib.json +18 -0
- package/dist/panda/preset.mjs +3907 -0
- package/dist/progress/Progress.d.ts +7 -0
- package/dist/progress/Progress.js +17 -0
- package/dist/prose/Prose.d.ts +10 -0
- package/dist/prose/Prose.js +10 -0
- package/dist/radio-group/RadioGroup.d.ts +15 -0
- package/dist/radio-group/RadioGroup.js +26 -0
- package/dist/select/Select.d.ts +11 -0
- package/dist/select/Select.js +21 -0
- package/dist/select/SelectPanel.d.ts +24 -0
- package/dist/select/SelectPanel.js +105 -0
- package/dist/shape.d.ts +16 -0
- package/dist/shape.js +17 -0
- package/dist/skeleton/Skeleton.d.ts +8 -0
- package/dist/skeleton/Skeleton.js +8 -0
- package/dist/spinner/Spinner.d.ts +7 -0
- package/dist/spinner/Spinner.js +13 -0
- package/dist/switch/Switch.d.ts +22 -0
- package/dist/switch/Switch.js +23 -0
- package/dist/table/DataTable.d.ts +12 -0
- package/dist/table/DataTable.js +12 -0
- package/dist/table/Table.d.ts +38 -0
- package/dist/table/Table.js +45 -0
- package/dist/tabs/Tabs.d.ts +11 -0
- package/dist/tabs/Tabs.js +20 -0
- package/dist/tag/Tag.d.ts +6 -0
- package/dist/tag/Tag.js +15 -0
- package/dist/textarea/Textarea.d.ts +9 -0
- package/dist/textarea/Textarea.js +14 -0
- package/dist/toast/Toast.d.ts +23 -0
- package/dist/toast/Toast.js +80 -0
- package/dist/tooltip/Tooltip.d.ts +9 -0
- package/dist/tooltip/Tooltip.js +29 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.js +1 -0
- package/package.json +218 -3
- package/styled-system/css/conditions.d.ts +7 -0
- package/styled-system/css/conditions.js +32 -0
- package/styled-system/css/css.d.ts +22 -0
- package/styled-system/css/css.js +63 -0
- package/styled-system/css/cva.d.ts +5 -0
- package/styled-system/css/cva.js +51 -0
- package/styled-system/css/cx.d.ts +6 -0
- package/styled-system/css/cx.js +16 -0
- package/styled-system/css/first-that-works.d.ts +22 -0
- package/styled-system/css/first-that-works.js +1 -0
- package/styled-system/css/index.d.ts +8 -0
- package/styled-system/css/index.js +8 -0
- package/styled-system/css/keyframes.d.ts +5 -0
- package/styled-system/css/keyframes.js +8 -0
- package/styled-system/css/position-try.d.ts +5 -0
- package/styled-system/css/position-try.js +11 -0
- package/styled-system/css/sva.d.ts +3 -0
- package/styled-system/css/sva.js +49 -0
- package/styled-system/css/view-transition.d.ts +7 -0
- package/styled-system/css/view-transition.js +18 -0
- package/styled-system/helpers.d.ts +67 -0
- package/styled-system/helpers.js +624 -0
- package/styled-system/jsx/aspect-ratio.d.ts +7 -0
- package/styled-system/jsx/aspect-ratio.js +11 -0
- package/styled-system/jsx/bleed.d.ts +7 -0
- package/styled-system/jsx/bleed.js +11 -0
- package/styled-system/jsx/box.d.ts +7 -0
- package/styled-system/jsx/box.js +11 -0
- package/styled-system/jsx/center.d.ts +7 -0
- package/styled-system/jsx/center.js +11 -0
- package/styled-system/jsx/circle.d.ts +7 -0
- package/styled-system/jsx/circle.js +11 -0
- package/styled-system/jsx/container.d.ts +7 -0
- package/styled-system/jsx/container.js +11 -0
- package/styled-system/jsx/cq.d.ts +7 -0
- package/styled-system/jsx/cq.js +11 -0
- package/styled-system/jsx/create-recipe-context.d.ts +32 -0
- package/styled-system/jsx/create-recipe-context.js +38 -0
- package/styled-system/jsx/create-slot-recipe-context.d.ts +48 -0
- package/styled-system/jsx/create-slot-recipe-context.js +116 -0
- package/styled-system/jsx/divider.d.ts +7 -0
- package/styled-system/jsx/divider.js +11 -0
- package/styled-system/jsx/factory.d.ts +3 -0
- package/styled-system/jsx/factory.js +91 -0
- package/styled-system/jsx/flex.d.ts +7 -0
- package/styled-system/jsx/flex.js +11 -0
- package/styled-system/jsx/float.d.ts +7 -0
- package/styled-system/jsx/float.js +11 -0
- package/styled-system/jsx/grid-item.d.ts +7 -0
- package/styled-system/jsx/grid-item.js +11 -0
- package/styled-system/jsx/grid.d.ts +7 -0
- package/styled-system/jsx/grid.js +11 -0
- package/styled-system/jsx/helper.d.ts +34 -0
- package/styled-system/jsx/helper.js +83 -0
- package/styled-system/jsx/hstack.d.ts +7 -0
- package/styled-system/jsx/hstack.js +11 -0
- package/styled-system/jsx/index.d.ts +25 -0
- package/styled-system/jsx/index.js +24 -0
- package/styled-system/jsx/is-valid-prop.d.ts +7 -0
- package/styled-system/jsx/is-valid-prop.js +12 -0
- package/styled-system/jsx/link-overlay.d.ts +7 -0
- package/styled-system/jsx/link-overlay.js +11 -0
- package/styled-system/jsx/spacer.d.ts +7 -0
- package/styled-system/jsx/spacer.js +11 -0
- package/styled-system/jsx/square.d.ts +7 -0
- package/styled-system/jsx/square.js +11 -0
- package/styled-system/jsx/stack.d.ts +7 -0
- package/styled-system/jsx/stack.js +11 -0
- package/styled-system/jsx/visually-hidden.d.ts +7 -0
- package/styled-system/jsx/visually-hidden.js +11 -0
- package/styled-system/jsx/vstack.d.ts +7 -0
- package/styled-system/jsx/vstack.js +11 -0
- package/styled-system/jsx/wrap.d.ts +7 -0
- package/styled-system/jsx/wrap.js +11 -0
- package/styled-system/patterns/aspect-ratio.d.ts +19 -0
- package/styled-system/patterns/aspect-ratio.js +37 -0
- package/styled-system/patterns/bleed.d.ts +20 -0
- package/styled-system/patterns/bleed.js +30 -0
- package/styled-system/patterns/box.d.ts +17 -0
- package/styled-system/patterns/box.js +16 -0
- package/styled-system/patterns/center.d.ts +19 -0
- package/styled-system/patterns/center.js +22 -0
- package/styled-system/patterns/circle.d.ts +19 -0
- package/styled-system/patterns/circle.js +26 -0
- package/styled-system/patterns/container.d.ts +17 -0
- package/styled-system/patterns/container.js +26 -0
- package/styled-system/patterns/cq.d.ts +21 -0
- package/styled-system/patterns/cq.js +24 -0
- package/styled-system/patterns/divider.d.ts +22 -0
- package/styled-system/patterns/divider.js +31 -0
- package/styled-system/patterns/flex.d.ts +25 -0
- package/styled-system/patterns/flex.js +27 -0
- package/styled-system/patterns/float.d.ts +23 -0
- package/styled-system/patterns/float.js +84 -0
- package/styled-system/patterns/grid-item.d.ts +24 -0
- package/styled-system/patterns/grid-item.js +26 -0
- package/styled-system/patterns/grid.d.ts +24 -0
- package/styled-system/patterns/grid.js +30 -0
- package/styled-system/patterns/hstack.d.ts +20 -0
- package/styled-system/patterns/hstack.js +27 -0
- package/styled-system/patterns/index.d.ts +20 -0
- package/styled-system/patterns/index.js +20 -0
- package/styled-system/patterns/link-overlay.d.ts +17 -0
- package/styled-system/patterns/link-overlay.js +25 -0
- package/styled-system/patterns/runtime.js +25 -0
- package/styled-system/patterns/spacer.d.ts +20 -0
- package/styled-system/patterns/spacer.js +26 -0
- package/styled-system/patterns/square.d.ts +19 -0
- package/styled-system/patterns/square.js +25 -0
- package/styled-system/patterns/stack.d.ts +22 -0
- package/styled-system/patterns/stack.js +30 -0
- package/styled-system/patterns/visually-hidden.d.ts +17 -0
- package/styled-system/patterns/visually-hidden.js +19 -0
- package/styled-system/patterns/vstack.d.ts +20 -0
- package/styled-system/patterns/vstack.js +27 -0
- package/styled-system/patterns/wrap.d.ts +23 -0
- package/styled-system/patterns/wrap.js +26 -0
- package/styled-system/recipes/alert.d.ts +19 -0
- package/styled-system/recipes/alert.js +5 -0
- package/styled-system/recipes/avatar.d.ts +19 -0
- package/styled-system/recipes/avatar.js +5 -0
- package/styled-system/recipes/badge.d.ts +18 -0
- package/styled-system/recipes/badge.js +5 -0
- package/styled-system/recipes/button.d.ts +20 -0
- package/styled-system/recipes/button.js +5 -0
- package/styled-system/recipes/card.d.ts +19 -0
- package/styled-system/recipes/card.js +5 -0
- package/styled-system/recipes/chat-bubble.d.ts +16 -0
- package/styled-system/recipes/chat-bubble.js +5 -0
- package/styled-system/recipes/checkbox.d.ts +16 -0
- package/styled-system/recipes/checkbox.js +5 -0
- package/styled-system/recipes/dialog.d.ts +18 -0
- package/styled-system/recipes/dialog.js +5 -0
- package/styled-system/recipes/field.d.ts +16 -0
- package/styled-system/recipes/field.js +5 -0
- package/styled-system/recipes/index.d.ts +27 -0
- package/styled-system/recipes/index.js +27 -0
- package/styled-system/recipes/input.d.ts +18 -0
- package/styled-system/recipes/input.js +5 -0
- package/styled-system/recipes/link.d.ts +18 -0
- package/styled-system/recipes/link.js +5 -0
- package/styled-system/recipes/pagination.d.ts +19 -0
- package/styled-system/recipes/pagination.js +5 -0
- package/styled-system/recipes/progress.d.ts +18 -0
- package/styled-system/recipes/progress.js +5 -0
- package/styled-system/recipes/prose.d.ts +16 -0
- package/styled-system/recipes/prose.js +5 -0
- package/styled-system/recipes/radio-group.d.ts +18 -0
- package/styled-system/recipes/radio-group.js +5 -0
- package/styled-system/recipes/runtime.js +133 -0
- package/styled-system/recipes/select-panel.d.ts +18 -0
- package/styled-system/recipes/select-panel.js +5 -0
- package/styled-system/recipes/select.d.ts +18 -0
- package/styled-system/recipes/select.js +5 -0
- package/styled-system/recipes/separator.d.ts +16 -0
- package/styled-system/recipes/separator.js +5 -0
- package/styled-system/recipes/skeleton.d.ts +14 -0
- package/styled-system/recipes/skeleton.js +5 -0
- package/styled-system/recipes/spinner.d.ts +16 -0
- package/styled-system/recipes/spinner.js +5 -0
- package/styled-system/recipes/switch-recipe.d.ts +16 -0
- package/styled-system/recipes/switch-recipe.js +5 -0
- package/styled-system/recipes/table.d.ts +20 -0
- package/styled-system/recipes/table.js +5 -0
- package/styled-system/recipes/tabs.d.ts +18 -0
- package/styled-system/recipes/tabs.js +5 -0
- package/styled-system/recipes/tag.d.ts +18 -0
- package/styled-system/recipes/tag.js +5 -0
- package/styled-system/recipes/textarea.d.ts +14 -0
- package/styled-system/recipes/textarea.js +5 -0
- package/styled-system/recipes/toast.d.ts +20 -0
- package/styled-system/recipes/toast.js +5 -0
- package/styled-system/recipes/tooltip.d.ts +16 -0
- package/styled-system/recipes/tooltip.js +5 -0
- package/styled-system/tokens/index.d.ts +8 -0
- package/styled-system/tokens/index.js +18 -0
- package/styled-system/types/index.d.ts +5 -0
- package/styled-system/types/jsx.d.ts +80 -0
- package/styled-system/types/pattern.d.ts +26 -0
- package/styled-system/types/recipe.d.ts +77 -0
- package/styled-system/types/system.d.ts +1645 -0
- package/styled-system/types/tokens.d.ts +47 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { stableStringify, toHash } from '../helpers';
|
|
2
|
+
|
|
3
|
+
export const keyframes = (keyframe) => {
|
|
4
|
+
const prefix = null
|
|
5
|
+
const wrap = (base) => (prefix ? prefix + '-' + base : base)
|
|
6
|
+
const block = keyframe && typeof keyframe === 'object' ? keyframe : {}
|
|
7
|
+
return wrap('kf_' + toHash(stableStringify(block)))
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { stableStringify, toHash } from '../helpers';
|
|
2
|
+
|
|
3
|
+
export const positionTry = (options) => {
|
|
4
|
+
const prefix = null
|
|
5
|
+
const wrap = (base) => '--' + (prefix ? prefix + '-' + base : base)
|
|
6
|
+
if (typeof options === 'string') {
|
|
7
|
+
return wrap('pt_' + options)
|
|
8
|
+
}
|
|
9
|
+
const block = options && typeof options === 'object' ? options : {}
|
|
10
|
+
return wrap('pt_' + toHash(stableStringify(block)))
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getSlotRecipes, memo, splitProps, toVariantMap, withDefaults } from '../helpers';
|
|
2
|
+
import { cva } from './cva';
|
|
3
|
+
import { cx } from './cx';
|
|
4
|
+
|
|
5
|
+
export const sva = (config) => {
|
|
6
|
+
const slotRecipes = getSlotRecipes(config)
|
|
7
|
+
const slots = []
|
|
8
|
+
for (const slot in slotRecipes) slots.push([slot, cva(slotRecipes[slot])])
|
|
9
|
+
|
|
10
|
+
const defaultVariants = config.defaultVariants ?? {}
|
|
11
|
+
|
|
12
|
+
const classNameMap = {}
|
|
13
|
+
if (config.className) {
|
|
14
|
+
for (const [slot, slotFn] of slots) classNameMap[slot] = slotFn.config.className
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const variants = config.variants ?? {}
|
|
18
|
+
const variantKeys = Object.keys(variants)
|
|
19
|
+
const variantMap = toVariantMap(variants)
|
|
20
|
+
|
|
21
|
+
const svaFn = (props) => {
|
|
22
|
+
const result = {}
|
|
23
|
+
for (const [slot, slotFn] of slots) result[slot] = cx(slotFn(props), classNameMap[slot])
|
|
24
|
+
return result
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const raw = (props) => {
|
|
28
|
+
const result = {}
|
|
29
|
+
for (const [slot, slotFn] of slots) result[slot] = slotFn.raw(props)
|
|
30
|
+
return result
|
|
31
|
+
}
|
|
32
|
+
const rawMemo = memo(raw)
|
|
33
|
+
|
|
34
|
+
return Object.assign(memo(svaFn), {
|
|
35
|
+
__cva__: false,
|
|
36
|
+
raw,
|
|
37
|
+
__memoizedRaw__: rawMemo,
|
|
38
|
+
config,
|
|
39
|
+
variantMap,
|
|
40
|
+
variantKeys,
|
|
41
|
+
classNameMap,
|
|
42
|
+
splitVariantProps(props) {
|
|
43
|
+
return splitProps(props, variantKeys)
|
|
44
|
+
},
|
|
45
|
+
getVariantProps(props) {
|
|
46
|
+
return withDefaults(defaultVariants, props)
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SystemStyleObject } from '../types/system';
|
|
2
|
+
|
|
3
|
+
export type ViewTransitionStyleObject = { group?: SystemStyleObject; imagePair?: SystemStyleObject; old?: SystemStyleObject; new?: SystemStyleObject };
|
|
4
|
+
|
|
5
|
+
export type ViewTransitionFn = (options: ViewTransitionStyleObject) => string;
|
|
6
|
+
|
|
7
|
+
export declare const viewTransition: ViewTransitionFn;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { stableStringify, toHash } from '../helpers';
|
|
2
|
+
|
|
3
|
+
export const viewTransition = (options) => {
|
|
4
|
+
const prefix = null
|
|
5
|
+
if (typeof options === 'string') {
|
|
6
|
+
const base = 'vt_' + options
|
|
7
|
+
return prefix ? prefix + '-' + base : base
|
|
8
|
+
}
|
|
9
|
+
const slots = ['group', 'imagePair', 'old', 'new']
|
|
10
|
+
const filtered = {}
|
|
11
|
+
if (options && typeof options === 'object') {
|
|
12
|
+
for (const key of slots) {
|
|
13
|
+
if (key in options) filtered[key] = options[key]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const base = 'vt_' + toHash(stableStringify(filtered))
|
|
17
|
+
return prefix ? prefix + '-' + base : base
|
|
18
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare function isObject(v: unknown): v is Record<string, unknown>;
|
|
2
|
+
|
|
3
|
+
export declare function isBaseCondition(v: string): boolean;
|
|
4
|
+
|
|
5
|
+
export declare function filterBaseConditions(c: string[]): string[];
|
|
6
|
+
|
|
7
|
+
export declare function toHash(v: string): string;
|
|
8
|
+
|
|
9
|
+
export declare function stableStringify(value: any): string;
|
|
10
|
+
|
|
11
|
+
export declare function toCssVar(path: string): string;
|
|
12
|
+
|
|
13
|
+
export declare function colorMix(tokens: Record<string, string>, path: string, resolveVar?: (path: string) => string): string | undefined;
|
|
14
|
+
|
|
15
|
+
export declare function compact<T extends Record<string, unknown>>(v: T): Partial<T>;
|
|
16
|
+
|
|
17
|
+
export declare function withDefaults(defaults: Record<string, any>, props: Record<string, any>): Record<string, any>;
|
|
18
|
+
|
|
19
|
+
export declare function toVariantMap(variants: Record<string, any>): Record<string, any>;
|
|
20
|
+
|
|
21
|
+
export declare function getCompoundVariantClassNames(compoundVariants: Array<Record<string, any>>, variants: Record<string, any>, formatClassName?: (className: string) => string): string;
|
|
22
|
+
|
|
23
|
+
export declare function getCompoundVariantCss(compoundVariants: Array<Record<string, any>>, variants: Record<string, any>): Record<string, any>;
|
|
24
|
+
|
|
25
|
+
export declare function getSlotCompoundVariant(compoundVariants: Array<Record<string, any>>, slot: string): Array<Record<string, any>>;
|
|
26
|
+
|
|
27
|
+
export declare function getSlotRecipes(recipe: Record<string, any>): Record<string, any>;
|
|
28
|
+
|
|
29
|
+
export declare function toResponsiveObject(values: any[], breakpoints: string[]): Record<string, any>;
|
|
30
|
+
|
|
31
|
+
export declare function walkObject(target: unknown, fn: (value: any, path: string[]) => any, options?: Record<string, any>): any;
|
|
32
|
+
|
|
33
|
+
export declare function mapObject(obj: unknown, fn: (value: any) => any): any;
|
|
34
|
+
|
|
35
|
+
export declare function normalizeStyleObject(styles: Record<string, any>, context: Record<string, any>, shorthand?: boolean): Record<string, any>;
|
|
36
|
+
|
|
37
|
+
export declare function memo<T extends (...args: any[]) => any>(fn: T): T;
|
|
38
|
+
|
|
39
|
+
export declare function weakMemo<T extends (arg: any) => any>(fn: T): T;
|
|
40
|
+
|
|
41
|
+
export declare function mergeProps(...src: Array<Record<string, any> | undefined>): Record<string, any>;
|
|
42
|
+
|
|
43
|
+
export declare function resolveStyleArgs(styles: Array<any> | IArguments, context: Record<string, any>): any[];
|
|
44
|
+
|
|
45
|
+
export declare function createSerializeCss(context: Record<string, any>): (...styles: any[]) => string;
|
|
46
|
+
|
|
47
|
+
export declare function createMergeCss(context: Record<string, any>): (...styles: any[]) => any;
|
|
48
|
+
|
|
49
|
+
export declare function createSerializeCssArgs(serializeCss: (...styles: any[]) => string, mergeCss: (...styles: any[]) => any): (...styles: any[]) => string;
|
|
50
|
+
|
|
51
|
+
export declare function createAssignCss(context: Record<string, any>): (...styles: any[]) => any;
|
|
52
|
+
|
|
53
|
+
export declare function hypenateProperty(property: string): string;
|
|
54
|
+
|
|
55
|
+
export declare function splitProps<T extends Record<string, any>>(props: T, ...keys: Array<Array<keyof T> | ((key: keyof T) => boolean)>): any[];
|
|
56
|
+
|
|
57
|
+
export declare const normalizeHTMLProps: ((props: Record<string, unknown>) => Record<string, unknown>) & {
|
|
58
|
+
keys: string[];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export declare function uniq<T>(...items: Array<T[] | undefined>): T[];
|
|
62
|
+
|
|
63
|
+
export declare function withoutSpace<T extends string | number | boolean>(str: T): T;
|
|
64
|
+
|
|
65
|
+
export declare function isImportant(value: unknown): boolean;
|
|
66
|
+
|
|
67
|
+
export declare function withoutImportant<T extends string | number | boolean>(value: T): T;
|