@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,5 @@
|
|
|
1
|
+
import { createSlotRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const selectPanelConfig = {"name":"selectPanel","className":"koi-select-panel","slots":["trigger","value","icon","positioner","popup","search","searchInput","list","empty","item","itemText","itemIndicator","group","groupLabel","separator"],"defaultVariants":{"size":"md"},"variantMap":{"size":["lg","md","sm"]}}
|
|
4
|
+
|
|
5
|
+
export const selectPanel = /* @__PURE__ */ createSlotRecipe(selectPanelConfig)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type SelectVariant = {
|
|
5
|
+
size?: "lg" | "md" | "sm"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type SelectVariantProps = {
|
|
9
|
+
[K in keyof SelectVariant]?: ConditionalValue<SelectVariant[K]>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type SelectVariantMap = RecipeVariantMap<SelectVariant>
|
|
13
|
+
|
|
14
|
+
export type SelectSlot = "root" | "el" | "chevron"
|
|
15
|
+
|
|
16
|
+
export type SelectRecipe = SlotRecipeRuntimeFn<SelectSlot, SelectVariantProps, SelectVariantMap>
|
|
17
|
+
|
|
18
|
+
export declare const select: SelectRecipe;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createSlotRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const selectConfig = {"name":"select","className":"koi-select","slots":["root","el","chevron"],"defaultVariants":{"size":"md"},"variantMap":{"size":["lg","md","sm"]}}
|
|
4
|
+
|
|
5
|
+
export const select = /* @__PURE__ */ createSlotRecipe(selectConfig)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { RecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type SeparatorVariant = {
|
|
5
|
+
kind?: "label" | "line" | "vertical"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type SeparatorVariantProps = {
|
|
9
|
+
[K in keyof SeparatorVariant]?: ConditionalValue<SeparatorVariant[K]>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type SeparatorVariantMap = RecipeVariantMap<SeparatorVariant>
|
|
13
|
+
|
|
14
|
+
export type SeparatorRecipe = RecipeRuntimeFn<SeparatorVariantProps, SeparatorVariantMap>
|
|
15
|
+
|
|
16
|
+
export declare const separator: SeparatorRecipe;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const separatorConfig = {"name":"separator","className":"koi-divider","defaultVariants":{"kind":"line"},"variantMap":{"kind":["label","line","vertical"]}}
|
|
4
|
+
|
|
5
|
+
export const separator = /* @__PURE__ */ createRecipe(separatorConfig)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { RecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type SkeletonVariant = {}
|
|
5
|
+
|
|
6
|
+
export type SkeletonVariantProps = {
|
|
7
|
+
[K in keyof SkeletonVariant]?: ConditionalValue<SkeletonVariant[K]>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type SkeletonVariantMap = RecipeVariantMap<SkeletonVariant>
|
|
11
|
+
|
|
12
|
+
export type SkeletonRecipe = RecipeRuntimeFn<SkeletonVariantProps, SkeletonVariantMap>
|
|
13
|
+
|
|
14
|
+
export declare const skeleton: SkeletonRecipe;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type SpinnerVariant = {}
|
|
5
|
+
|
|
6
|
+
export type SpinnerVariantProps = {
|
|
7
|
+
[K in keyof SpinnerVariant]?: ConditionalValue<SpinnerVariant[K]>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type SpinnerVariantMap = RecipeVariantMap<SpinnerVariant>
|
|
11
|
+
|
|
12
|
+
export type SpinnerSlot = "root" | "svg"
|
|
13
|
+
|
|
14
|
+
export type SpinnerRecipe = SlotRecipeRuntimeFn<SpinnerSlot, SpinnerVariantProps, SpinnerVariantMap>
|
|
15
|
+
|
|
16
|
+
export declare const spinner: SpinnerRecipe;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type SwitchRecipeVariant = {}
|
|
5
|
+
|
|
6
|
+
export type SwitchRecipeVariantProps = {
|
|
7
|
+
[K in keyof SwitchRecipeVariant]?: ConditionalValue<SwitchRecipeVariant[K]>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type SwitchRecipeVariantMap = RecipeVariantMap<SwitchRecipeVariant>
|
|
11
|
+
|
|
12
|
+
export type SwitchRecipeSlot = "root" | "control" | "thumb" | "label"
|
|
13
|
+
|
|
14
|
+
export type SwitchRecipeRecipe = SlotRecipeRuntimeFn<SwitchRecipeSlot, SwitchRecipeVariantProps, SwitchRecipeVariantMap>
|
|
15
|
+
|
|
16
|
+
export declare const switchRecipe: SwitchRecipeRecipe;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type TableVariant = {
|
|
5
|
+
align?: "center" | "end" | "start"
|
|
6
|
+
layout?: "auto" | "fixed"
|
|
7
|
+
paddingBlock?: "default" | "none"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TableVariantProps = {
|
|
11
|
+
[K in keyof TableVariant]?: ConditionalValue<TableVariant[K]>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TableVariantMap = RecipeVariantMap<TableVariant>
|
|
15
|
+
|
|
16
|
+
export type TableSlot = "container" | "root" | "header" | "body" | "footer" | "row" | "headerCell" | "cell" | "sortButton" | "empty" | "caption" | "skeleton"
|
|
17
|
+
|
|
18
|
+
export type TableRecipe = SlotRecipeRuntimeFn<TableSlot, TableVariantProps, TableVariantMap>
|
|
19
|
+
|
|
20
|
+
export declare const table: TableRecipe;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createSlotRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const tableConfig = {"name":"table","className":"koi-table","slots":["container","root","header","body","footer","row","headerCell","cell","sortButton","empty","caption","skeleton"],"defaultVariants":{"align":"start","layout":"auto","paddingBlock":"default"},"variantMap":{"align":["center","end","start"],"layout":["auto","fixed"],"paddingBlock":["default","none"]}}
|
|
4
|
+
|
|
5
|
+
export const table = /* @__PURE__ */ createSlotRecipe(tableConfig)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type TabsVariant = {
|
|
5
|
+
fullWidth?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type TabsVariantProps = {
|
|
9
|
+
[K in keyof TabsVariant]?: ConditionalValue<TabsVariant[K]>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type TabsVariantMap = RecipeVariantMap<TabsVariant>
|
|
13
|
+
|
|
14
|
+
export type TabsSlot = "root" | "list" | "tab" | "indicator" | "panel"
|
|
15
|
+
|
|
16
|
+
export type TabsRecipe = SlotRecipeRuntimeFn<TabsSlot, TabsVariantProps, TabsVariantMap>
|
|
17
|
+
|
|
18
|
+
export declare const tabs: TabsRecipe;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createSlotRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const tabsConfig = {"name":"tabs","className":"koi-tabs","slots":["root","list","tab","indicator","panel"],"defaultVariants":{"fullWidth":false},"variantMap":{"fullWidth":["false","true"]}}
|
|
4
|
+
|
|
5
|
+
export const tabs = /* @__PURE__ */ createSlotRecipe(tabsConfig)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type TagVariant = {
|
|
5
|
+
selected?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type TagVariantProps = {
|
|
9
|
+
[K in keyof TagVariant]?: ConditionalValue<TagVariant[K]>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type TagVariantMap = RecipeVariantMap<TagVariant>
|
|
13
|
+
|
|
14
|
+
export type TagSlot = "root" | "toggle" | "icon" | "label" | "remove"
|
|
15
|
+
|
|
16
|
+
export type TagRecipe = SlotRecipeRuntimeFn<TagSlot, TagVariantProps, TagVariantMap>
|
|
17
|
+
|
|
18
|
+
export declare const tag: TagRecipe;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createSlotRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const tagConfig = {"name":"tag","className":"koi-tag","slots":["root","toggle","icon","label","remove"],"defaultVariants":{"selected":false},"variantMap":{"selected":["false","true"]}}
|
|
4
|
+
|
|
5
|
+
export const tag = /* @__PURE__ */ createSlotRecipe(tagConfig)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { RecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type TextareaVariant = {}
|
|
5
|
+
|
|
6
|
+
export type TextareaVariantProps = {
|
|
7
|
+
[K in keyof TextareaVariant]?: ConditionalValue<TextareaVariant[K]>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TextareaVariantMap = RecipeVariantMap<TextareaVariant>
|
|
11
|
+
|
|
12
|
+
export type TextareaRecipe = RecipeRuntimeFn<TextareaVariantProps, TextareaVariantMap>
|
|
13
|
+
|
|
14
|
+
export declare const textarea: TextareaRecipe;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type ToastVariant = {
|
|
5
|
+
closable?: boolean
|
|
6
|
+
position?: "bottom" | "static" | "top"
|
|
7
|
+
tone?: "error" | "info" | "success" | "warning"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type ToastVariantProps = {
|
|
11
|
+
[K in keyof ToastVariant]?: ConditionalValue<ToastVariant[K]>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ToastVariantMap = RecipeVariantMap<ToastVariant>
|
|
15
|
+
|
|
16
|
+
export type ToastSlot = "viewport" | "root" | "icon" | "content" | "title" | "description" | "action" | "close"
|
|
17
|
+
|
|
18
|
+
export type ToastRecipe = SlotRecipeRuntimeFn<ToastSlot, ToastVariantProps, ToastVariantMap>
|
|
19
|
+
|
|
20
|
+
export declare const toast: ToastRecipe;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createSlotRecipe } from './runtime';
|
|
2
|
+
|
|
3
|
+
const toastConfig = {"name":"toast","className":"koi-toast","slots":["viewport","root","icon","content","title","description","action","close"],"defaultVariants":{"closable":false,"position":"static","tone":"info"},"variantMap":{"closable":["false","true"],"position":["bottom","static","top"],"tone":["error","info","success","warning"]}}
|
|
4
|
+
|
|
5
|
+
export const toast = /* @__PURE__ */ createSlotRecipe(toastConfig)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConditionalValue } from '../types/system';
|
|
2
|
+
import type { SlotRecipeRuntimeFn, RecipeVariantMap } from '../types/recipe';
|
|
3
|
+
|
|
4
|
+
export type TooltipVariant = {}
|
|
5
|
+
|
|
6
|
+
export type TooltipVariantProps = {
|
|
7
|
+
[K in keyof TooltipVariant]?: ConditionalValue<TooltipVariant[K]>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TooltipVariantMap = RecipeVariantMap<TooltipVariant>
|
|
11
|
+
|
|
12
|
+
export type TooltipSlot = "positioner" | "popup"
|
|
13
|
+
|
|
14
|
+
export type TooltipRecipe = SlotRecipeRuntimeFn<TooltipSlot, TooltipVariantProps, TooltipVariantMap>
|
|
15
|
+
|
|
16
|
+
export declare const tooltip: TooltipRecipe;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { colorMix, toCssVar } from '../helpers';
|
|
2
|
+
|
|
3
|
+
const tokens = {"blurs.float":"40px","blurs.panel":"24px","breakpoints.md":"768px","colors.accent-edge":"","colors.accent-fg":"","colors.accent-soft":"","colors.accent-soft-hover":"","colors.accent-solid":"var(--colors-accent-400)","colors.accent-solid-hover":"var(--colors-accent-300)","colors.accent.100":"","colors.accent.200":"","colors.accent.300":"","colors.accent.400":"","colors.accent.50":"","colors.accent.500":"","colors.accent.600":"","colors.accent.700":"","colors.accent.800":"","colors.accent.900":"","colors.accent.950":"","colors.action":"var(--colors-primary-700)","colors.action-hover":"var(--colors-primary-800)","colors.action-subtle":"","colors.action-subtle-hover":"","colors.backdrop":"","colors.black":"#000000","colors.border":"","colors.border-control":"var(--colors-secondary-500)","colors.border-control-hover":"","colors.code-block-bg":"var(--colors-secondary-800)","colors.code-block-text":"","colors.colorPalette":"","colors.colorPalette.100":"","colors.colorPalette.200":"","colors.colorPalette.300":"","colors.colorPalette.400":"","colors.colorPalette.50":"","colors.colorPalette.500":"","colors.colorPalette.600":"","colors.colorPalette.700":"","colors.colorPalette.800":"","colors.colorPalette.900":"","colors.colorPalette.950":"","colors.control-checked":"","colors.danger":"var(--colors-error-600)","colors.danger-hover":"var(--colors-error-700)","colors.divider":"","colors.error-border":"","colors.error-control":"","colors.error-edge":"","colors.error-fg":"","colors.error-soft":"","colors.error-soft-hover":"","colors.error-solid":"var(--colors-danger)","colors.error-solid-hover":"var(--colors-danger-hover)","colors.error-surface":"","colors.error-text":"","colors.error.100":"oklch(93.6% 0.032 17.717)","colors.error.200":"oklch(88.5% 0.062 18.334)","colors.error.300":"oklch(80.8% 0.114 19.571)","colors.error.400":"oklch(70.4% 0.191 22.216)","colors.error.50":"oklch(97.1% 0.013 17.38)","colors.error.500":"oklch(63.7% 0.237 25.331)","colors.error.600":"oklch(57.7% 0.245 27.325)","colors.error.700":"oklch(50.5% 0.213 27.518)","colors.error.800":"oklch(44.4% 0.177 26.899)","colors.error.900":"oklch(39.6% 0.141 25.723)","colors.error.950":"oklch(25.8% 0.092 26.042)","colors.focus-ring":"","colors.highlight":"","colors.info-border":"","colors.info-surface":"","colors.info-text":"","colors.link":"","colors.link-border":"","colors.link-hover-bg":"","colors.link-hover-border":"","colors.nav-item-active":"","colors.nav-item-hover":"","colors.nav-item-text":"","colors.on-accent-soft":"","colors.on-accent-solid":"var(--colors-accent-950)","colors.on-action":"var(--colors-white)","colors.on-action-subtle":"","colors.on-error-soft":"","colors.on-error-solid":"var(--colors-on-action)","colors.on-highlight":"","colors.on-primary-soft":"var(--colors-on-action-subtle)","colors.on-primary-solid":"var(--colors-on-action)","colors.on-secondary-soft":"","colors.on-secondary-solid":"","colors.on-warning-soft":"","colors.on-warning-solid":"var(--colors-warning-950)","colors.page-bg":"","colors.primary-edge":"","colors.primary-fg":"var(--colors-text-brand)","colors.primary-soft":"var(--colors-action-subtle)","colors.primary-soft-hover":"var(--colors-action-subtle-hover)","colors.primary-solid":"var(--colors-action)","colors.primary-solid-hover":"var(--colors-action-hover)","colors.primary.100":"","colors.primary.200":"","colors.primary.300":"","colors.primary.400":"","colors.primary.50":"","colors.primary.500":"","colors.primary.600":"","colors.primary.700":"","colors.primary.800":"","colors.primary.900":"","colors.primary.950":"","colors.prose-text":"","colors.secondary-edge":"var(--colors-secondary-500)","colors.secondary-fg":"","colors.secondary-soft":"","colors.secondary-soft-hover":"","colors.secondary-solid":"","colors.secondary-solid-hover":"","colors.secondary.100":"oklch(96.7% 0.003 264.542)","colors.secondary.200":"oklch(92.8% 0.006 264.531)","colors.secondary.300":"oklch(87.2% 0.01 258.338)","colors.secondary.400":"oklch(70.7% 0.022 261.325)","colors.secondary.50":"oklch(98.5% 0.002 247.839)","colors.secondary.500":"oklch(55.1% 0.027 264.364)","colors.secondary.600":"oklch(44.6% 0.03 256.802)","colors.secondary.700":"oklch(37.3% 0.034 259.733)","colors.secondary.800":"oklch(27.8% 0.033 256.848)","colors.secondary.900":"oklch(21% 0.034 264.665)","colors.secondary.950":"oklch(13% 0.028 261.692)","colors.skeleton":"","colors.skeleton-highlight":"","colors.surface":"","colors.surface-glass":"","colors.surface-glass-tint":"","colors.surface-muted":"","colors.table-row-hover":"","colors.text":"","colors.text-brand":"","colors.text-disabled":"","colors.text-muted":"","colors.tooltip-bg":"","colors.tooltip-text":"","colors.warning-border":"","colors.warning-edge":"","colors.warning-fg":"","colors.warning-soft":"","colors.warning-soft-hover":"","colors.warning-solid":"var(--colors-warning-400)","colors.warning-solid-hover":"var(--colors-warning-300)","colors.warning-surface":"","colors.warning-text":"","colors.warning.100":"oklch(97.3% 0.071 103.193)","colors.warning.200":"oklch(94.5% 0.129 101.54)","colors.warning.300":"oklch(90.5% 0.182 98.111)","colors.warning.400":"oklch(85.2% 0.199 91.936)","colors.warning.50":"oklch(98.7% 0.026 102.212)","colors.warning.500":"oklch(79.5% 0.184 86.047)","colors.warning.600":"oklch(68.1% 0.162 75.834)","colors.warning.700":"oklch(55.4% 0.135 66.442)","colors.warning.800":"oklch(47.6% 0.114 61.907)","colors.warning.900":"oklch(42.1% 0.095 57.708)","colors.warning.950":"oklch(28.6% 0.066 53.813)","colors.white":"#ffffff","durations.check":"250ms","durations.dialog":"300ms","durations.fast":"150ms","durations.indeterminate":"1.2s","durations.overlay":"200ms","durations.pulse":"2s","durations.ripple":"600ms","durations.shimmer":"1.6s","durations.spin":"800ms","durations.spin-slow":"1.6s","durations.spring":"400ms","easings.out":"cubic-bezier(0, 0, .2, 1)","easings.spring":"cubic-bezier(.47,1.64,.41,.8)","fonts.sans":"","radii.2xl":"16px","radii.bar":"36px","radii.dialog":"32px","radii.full":"9999px","radii.lg":"8px","radii.panel":"24px","radii.sm":"6px","radii.xl":"12px","shadows.float":"0 25px 50px -12px rgba(0, 0, 0, 0.25)","shadows.float-soft":"0 25px 50px -12px rgba(0, 0, 0, 0.15)","shadows.raised":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)","sizes.breakpoint-md":"768px","sizes.content-max":"56rem","sizes.control-lg":"44px","sizes.control-md":"36px","sizes.control-sm":"28px","sizes.icon":"16px","sizes.icon-lg":"18px","sizes.icon-sm":"14px","sizes.icon-xs":"12px","spacing.-1":"calc(var(--spacing-1) * -1)","spacing.-10":"calc(var(--spacing-10) * -1)","spacing.-12":"calc(var(--spacing-12) * -1)","spacing.-16":"calc(var(--spacing-16) * -1)","spacing.-2":"calc(var(--spacing-2) * -1)","spacing.-3":"calc(var(--spacing-3) * -1)","spacing.-4":"calc(var(--spacing-4) * -1)","spacing.-5":"calc(var(--spacing-5) * -1)","spacing.-6":"calc(var(--spacing-6) * -1)","spacing.-8":"calc(var(--spacing-8) * -1)","spacing.1":"4px","spacing.10":"40px","spacing.12":"48px","spacing.16":"64px","spacing.2":"8px","spacing.3":"12px","spacing.4":"16px","spacing.5":"20px","spacing.6":"24px","spacing.8":"32px","zIndex.dialog":"900","zIndex.popup":"950","zIndex.toast":"1000","zIndex.tooltip":"1000"}
|
|
4
|
+
|
|
5
|
+
const tokenVars = {"spacing.-1":"var(--spacing-1)","spacing.-10":"var(--spacing-10)","spacing.-12":"var(--spacing-12)","spacing.-16":"var(--spacing-16)","spacing.-2":"var(--spacing-2)","spacing.-3":"var(--spacing-3)","spacing.-4":"var(--spacing-4)","spacing.-5":"var(--spacing-5)","spacing.-6":"var(--spacing-6)","spacing.-8":"var(--spacing-8)"}
|
|
6
|
+
const resolveVar = (path) => tokenVars[path] || toCssVar(path)
|
|
7
|
+
|
|
8
|
+
export const token = /* @__PURE__ */ Object.assign(
|
|
9
|
+
function token(path, fallback) {
|
|
10
|
+
const value = tokens[path]
|
|
11
|
+
return value === undefined ? colorMix(tokens, path, resolveVar) || fallback : value || resolveVar(path)
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
var: function tokenVar(path, fallback) {
|
|
15
|
+
return tokens[path] === undefined ? fallback : resolveVar(path)
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { ElementType, JSX } from 'react';
|
|
2
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe';
|
|
3
|
+
import type { Assign, JsxHTMLProps, JsxStyleProps } from './system';
|
|
4
|
+
|
|
5
|
+
interface AnyProps {
|
|
6
|
+
[k: string]: unknown
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type DataAttrs = Record<`data-${string}`, unknown>
|
|
10
|
+
|
|
11
|
+
export interface UnstyledProps {
|
|
12
|
+
unstyled?: boolean | undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AsProps {
|
|
16
|
+
as?: ElementType | undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ComponentProps<T extends ElementType> = T extends keyof JSX.IntrinsicElements
|
|
20
|
+
? JSX.IntrinsicElements[T]
|
|
21
|
+
: T extends { (props: infer Props): any }
|
|
22
|
+
? Props
|
|
23
|
+
: T extends abstract new (props: infer Props) => any
|
|
24
|
+
? Props
|
|
25
|
+
: {}
|
|
26
|
+
|
|
27
|
+
type BaseComponentProps<T extends ElementType> = ComponentProps<T> & UnstyledProps & AsProps
|
|
28
|
+
|
|
29
|
+
export type StyledComponentProps<T extends ElementType, P extends AnyProps = {}> = JsxHTMLProps<
|
|
30
|
+
BaseComponentProps<T>,
|
|
31
|
+
Assign<JsxStyleProps, P>
|
|
32
|
+
>
|
|
33
|
+
|
|
34
|
+
export interface StyledComponent<T extends ElementType, P extends AnyProps = {}> {
|
|
35
|
+
(props: StyledComponentProps<T, P>): JSX.Element
|
|
36
|
+
displayName?: string | undefined
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface RuntimeRecipeFn {
|
|
40
|
+
__type: any
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface JsxFactoryOptions<TProps extends AnyProps, F extends string = string> {
|
|
44
|
+
dataAttr?: boolean
|
|
45
|
+
defaultProps?: Partial<TProps> & DataAttrs
|
|
46
|
+
shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
|
|
47
|
+
forwardProps?: readonly F[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Distributes over the few forwarded keys; never intersects the large key unions.
|
|
51
|
+
type ForwardedStyleKeys<T extends ElementType, F extends string> = F extends keyof JsxStyleProps
|
|
52
|
+
? F extends keyof ComponentProps<T> ? F : never
|
|
53
|
+
: never
|
|
54
|
+
|
|
55
|
+
/** Props `S`, with each forwarded prop that shares a style prop's name typed from the component. */
|
|
56
|
+
export type WithForwardedProps<S, T extends ElementType, F extends string> = [ForwardedStyleKeys<T, F>] extends [never]
|
|
57
|
+
? S
|
|
58
|
+
: Assign<S, Pick<ComponentProps<T>, ForwardedStyleKeys<T, F>>>
|
|
59
|
+
|
|
60
|
+
export type JsxRecipeProps<T extends ElementType, P extends AnyProps> = JsxHTMLProps<BaseComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
61
|
+
|
|
62
|
+
export type JsxElement<T extends ElementType, P extends AnyProps> = T extends StyledComponent<infer A, infer B>
|
|
63
|
+
? StyledComponent<A, Assign<B, P>>
|
|
64
|
+
: StyledComponent<T, P>
|
|
65
|
+
|
|
66
|
+
export interface JsxFactory {
|
|
67
|
+
<T extends ElementType>(component: T): StyledComponent<T, {}>
|
|
68
|
+
<T extends ElementType, P extends RecipeVariantRecord = {}, F extends string = never>(component: T, recipe: RecipeDefinition<P>, options?: JsxFactoryOptions<JsxRecipeProps<T, RecipeSelection<P>>, F>): JsxElement<T, WithForwardedProps<RecipeSelection<P>, T, F>>
|
|
69
|
+
<T extends ElementType, P extends RuntimeRecipeFn, F extends string = never>(component: T, recipeFn: P, options?: JsxFactoryOptions<JsxRecipeProps<T, P["__type"]>, F>): JsxElement<T, WithForwardedProps<P["__type"], T, F>>
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type JsxElements = {
|
|
73
|
+
[K in keyof JSX.IntrinsicElements]: StyledComponent<K, {}>
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type Styled = JsxFactory & JsxElements
|
|
77
|
+
|
|
78
|
+
export type HTMLStyledProps<T extends ElementType> = JsxHTMLProps<BaseComponentProps<T>, JsxStyleProps>
|
|
79
|
+
|
|
80
|
+
export type StyledVariantProps<T extends StyledComponent<any, any>> = T extends StyledComponent<any, infer Props> ? Props : never
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ConditionalValue, SystemProperties, SystemStyleObject } from './system';
|
|
2
|
+
|
|
3
|
+
export type PatternPrimitive = string | number | boolean
|
|
4
|
+
|
|
5
|
+
export type PatternPropertyValue<Property extends keyof SystemProperties> = SystemProperties[Property]
|
|
6
|
+
|
|
7
|
+
export type PatternTokenValue<Value> = ConditionalValue<Value>
|
|
8
|
+
|
|
9
|
+
export interface PatternHelpers {
|
|
10
|
+
map(value: unknown, fn: (value: string) => string | undefined): unknown
|
|
11
|
+
isCssUnit(value: unknown): boolean
|
|
12
|
+
isCssVar(value: unknown): boolean
|
|
13
|
+
isCssFunction(value: unknown): boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface PatternConfig<Props extends object = object> {
|
|
17
|
+
properties?: Props
|
|
18
|
+
defaultValues?: Partial<Props> | ((props: Props) => Partial<Props>)
|
|
19
|
+
transform?: (props: Props, helpers: PatternHelpers) => SystemStyleObject
|
|
20
|
+
strict?: boolean
|
|
21
|
+
blocklist?: Array<keyof SystemProperties>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface PatternRuntimeConfig<Props extends object = object> extends PatternConfig<Props> {
|
|
25
|
+
transform: (props: Props, helpers: PatternHelpers) => SystemStyleObject
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { SystemStyleObject } from './system';
|
|
2
|
+
|
|
3
|
+
export type RecipeVariantProps<T> = T extends (props?: infer Props) => unknown ? Props : never
|
|
4
|
+
|
|
5
|
+
export type RecipeVariant<T> = Required<NonNullable<RecipeVariantProps<T>>>
|
|
6
|
+
|
|
7
|
+
export type RecipeVariantMap<Variant extends object> = {
|
|
8
|
+
[K in keyof Variant]-?: Array<Exclude<Variant[K], undefined>>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type RecipeConfigVariantMap<T> = {
|
|
12
|
+
[K in keyof T]: Array<keyof T[K]>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface RecipeRuntimeFn<Props extends object = object, Map extends object = object> {
|
|
16
|
+
(props?: Props): string
|
|
17
|
+
__type: Props
|
|
18
|
+
variantMap: Map
|
|
19
|
+
variantKeys: Array<keyof Props>
|
|
20
|
+
raw: (props?: Props) => SystemStyleObject
|
|
21
|
+
splitVariantProps<T extends Record<string, any>>(props: T): [Props, Omit<T, keyof Props>]
|
|
22
|
+
getVariantProps: (props?: Props) => Props
|
|
23
|
+
merge(recipe: RecipeRuntimeFn): RecipeRuntimeFn
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type SlotRecord<Slot extends string, Value> = Partial<Record<Slot, Value>>
|
|
27
|
+
|
|
28
|
+
export interface SlotRecipeRuntimeFn<Slot extends string, Props extends object = object, Map extends object = object> {
|
|
29
|
+
(props?: Props): Record<Slot, string>
|
|
30
|
+
__type: Props
|
|
31
|
+
__slot: Slot
|
|
32
|
+
variantMap: Map
|
|
33
|
+
variantKeys: Array<keyof Props>
|
|
34
|
+
raw: (props?: Props) => Record<Slot, SystemStyleObject>
|
|
35
|
+
splitVariantProps<T extends Record<string, any>>(props: T): [Props, Omit<T, keyof Props>]
|
|
36
|
+
getVariantProps: (props?: Props) => Props
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
40
|
+
|
|
41
|
+
export type RecipeVariantRecord = Record<string, Record<string, SystemStyleObject>>
|
|
42
|
+
|
|
43
|
+
export type RecipeSelection<T extends RecipeVariantRecord> = string extends keyof T
|
|
44
|
+
? {}
|
|
45
|
+
: {
|
|
46
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]> | undefined
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type RecipeCompoundSelection<T> = {
|
|
50
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>> | undefined
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {
|
|
54
|
+
base?: SystemStyleObject
|
|
55
|
+
variants?: T
|
|
56
|
+
defaultVariants?: RecipeSelection<T>
|
|
57
|
+
compoundVariants?: Array<RecipeCompoundSelection<T> & { css: SystemStyleObject }>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface RecipeCreatorFn {
|
|
61
|
+
<T extends RecipeVariantRecord>(config: RecipeDefinition<T>): RecipeRuntimeFn<RecipeSelection<T>, RecipeConfigVariantMap<T>>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type SlotRecipeVariantRecord<Slot extends string> = Record<string, Record<string, SlotRecord<Slot, SystemStyleObject>>>
|
|
65
|
+
|
|
66
|
+
export interface SlotRecipeDefinition<Slot extends string = string, T extends SlotRecipeVariantRecord<Slot> = SlotRecipeVariantRecord<Slot>> {
|
|
67
|
+
className?: string
|
|
68
|
+
slots: readonly Slot[]
|
|
69
|
+
base?: SlotRecord<Slot, SystemStyleObject>
|
|
70
|
+
variants?: T
|
|
71
|
+
defaultVariants?: RecipeSelection<T>
|
|
72
|
+
compoundVariants?: Array<RecipeCompoundSelection<T> & { css: SlotRecord<Slot, SystemStyleObject> }>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SlotRecipeCreatorFn {
|
|
76
|
+
<Slot extends string, T extends SlotRecipeVariantRecord<Slot>>(config: SlotRecipeDefinition<Slot, T>): SlotRecipeRuntimeFn<Slot, RecipeSelection<T>, RecipeConfigVariantMap<T>>
|
|
77
|
+
}
|