@stokelp/styled-system 1.17.0 → 1.19.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/package.json +1 -1
- package/panda.buildinfo.json +14 -0
- package/patterns/aspect-ratio.mjs +2 -2
- package/patterns/bleed.mjs +2 -2
- package/patterns/box.mjs +2 -2
- package/patterns/center.mjs +2 -2
- package/patterns/circle.mjs +2 -2
- package/patterns/container.mjs +2 -2
- package/patterns/cq.mjs +2 -2
- package/patterns/divider.mjs +2 -2
- package/patterns/flex.mjs +2 -2
- package/patterns/float.mjs +4 -4
- package/patterns/grid-item.mjs +2 -2
- package/patterns/grid.mjs +4 -4
- package/patterns/hstack.mjs +2 -2
- package/patterns/link-overlay.mjs +3 -3
- package/patterns/spacer.mjs +2 -2
- package/patterns/square.mjs +2 -2
- package/patterns/stack.mjs +2 -2
- package/patterns/visually-hidden.mjs +2 -2
- package/patterns/vstack.mjs +2 -2
- package/patterns/wrap.mjs +2 -2
- package/recipes/icon-button.d.ts +43 -0
- package/recipes/icon-button.mjs +116 -0
- package/recipes/index.d.ts +3 -1
- package/recipes/index.mjs +3 -1
- package/recipes/tooltip.d.ts +28 -0
- package/recipes/tooltip.mjs +48 -0
package/package.json
CHANGED
package/panda.buildinfo.json
CHANGED
|
@@ -53,6 +53,11 @@
|
|
|
53
53
|
"gridTemplateColumns]___[value:repeat(3, 1fr)",
|
|
54
54
|
"gap]___[value:10px",
|
|
55
55
|
"flexDirection]___[value:row",
|
|
56
|
+
"gap]___[value:120",
|
|
57
|
+
"overflow]___[value:auto",
|
|
58
|
+
"padding]___[value:space-64",
|
|
59
|
+
"height]___[value:500",
|
|
60
|
+
"background]___[value:grey.100",
|
|
56
61
|
"borderRadius]___[value:radius-4",
|
|
57
62
|
"display]___[value:inline-flex",
|
|
58
63
|
"gap]___[value:space-4",
|
|
@@ -88,6 +93,14 @@
|
|
|
88
93
|
"variant]___[value:tertiary]___[recipe:button",
|
|
89
94
|
"variant]___[value:primary]___[recipe:button"
|
|
90
95
|
],
|
|
96
|
+
"iconButton": [
|
|
97
|
+
"size]___[value:sm]___[recipe:iconButton",
|
|
98
|
+
"variant]___[value:secondary]___[recipe:iconButton",
|
|
99
|
+
"severity]___[value:none]___[recipe:iconButton",
|
|
100
|
+
"size]___[value:md]___[recipe:iconButton",
|
|
101
|
+
"variant]___[value:tertiary]___[recipe:iconButton",
|
|
102
|
+
"variant]___[value:primary]___[recipe:iconButton"
|
|
103
|
+
],
|
|
91
104
|
"formControl": [],
|
|
92
105
|
"formLabel": [
|
|
93
106
|
"variant]___[value:absolute]___[recipe:formLabel"
|
|
@@ -124,6 +137,7 @@
|
|
|
124
137
|
"tabs": [
|
|
125
138
|
"variant]___[value:line]___[recipe:tabs"
|
|
126
139
|
],
|
|
140
|
+
"tooltip": [],
|
|
127
141
|
"datepicker": [],
|
|
128
142
|
"formHelperText": [],
|
|
129
143
|
"select": [
|
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const aspectRatioConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { ratio = 4 / 3, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { ratio = 4 / 3, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
position: "relative",
|
|
9
9
|
_before: {
|
package/patterns/bleed.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const bleedConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { inline, block, ...rest } =
|
|
5
|
+
transform(props10, { map, isCssUnit, isCssVar }) {
|
|
6
|
+
const { inline, block, ...rest } = props10;
|
|
7
7
|
const valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
"--bleed-x": map(inline, valueFn),
|
package/patterns/box.mjs
CHANGED
package/patterns/center.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const centerConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { inline, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { inline, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: inline ? "inline-flex" : "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/circle.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const circleConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { size, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { size, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/container.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const containerConfig = {
|
|
5
|
-
transform(
|
|
5
|
+
transform(props10) {
|
|
6
6
|
return {
|
|
7
7
|
position: "relative",
|
|
8
8
|
maxWidth: "8xl",
|
|
9
9
|
mx: "auto",
|
|
10
10
|
px: { base: "4", md: "6", lg: "8" },
|
|
11
|
-
...
|
|
11
|
+
...props10
|
|
12
12
|
};
|
|
13
13
|
}}
|
|
14
14
|
|
package/patterns/cq.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const cqConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { name, type, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { name, type, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
containerType: type,
|
|
9
9
|
containerName: name,
|
package/patterns/divider.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const dividerConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { orientation, thickness, color, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { orientation, thickness, color, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
"--thickness": thickness,
|
|
9
9
|
width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
|
package/patterns/flex.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const flexConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexDirection: direction,
|
package/patterns/float.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const floatConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { offset, offsetX, offsetY, placement, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { offset, offsetX, offsetY, placement, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "inline-flex",
|
|
9
9
|
justifyContent: "center",
|
|
@@ -38,8 +38,8 @@ transform(props9, { map }) {
|
|
|
38
38
|
...rest
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
|
-
defaultValues(
|
|
42
|
-
const offset =
|
|
41
|
+
defaultValues(props10) {
|
|
42
|
+
const offset = props10.offset || "0";
|
|
43
43
|
return { offset, offsetX: offset, offsetY: offset, placement: "top-end" };
|
|
44
44
|
}}
|
|
45
45
|
|
package/patterns/grid-item.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const gridItemConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props10;
|
|
7
7
|
const spanFn = (v) => v === "auto" ? v : `span ${v}`;
|
|
8
8
|
return {
|
|
9
9
|
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
|
package/patterns/grid.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const gridConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } =
|
|
5
|
+
transform(props10, { map, isCssUnit }) {
|
|
6
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props10;
|
|
7
7
|
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
display: "grid",
|
|
@@ -14,8 +14,8 @@ transform(props9, { map, isCssUnit }) {
|
|
|
14
14
|
...rest
|
|
15
15
|
};
|
|
16
16
|
},
|
|
17
|
-
defaultValues(
|
|
18
|
-
return { gap:
|
|
17
|
+
defaultValues(props10) {
|
|
18
|
+
return { gap: props10.columnGap || props10.rowGap ? void 0 : "10px" };
|
|
19
19
|
}}
|
|
20
20
|
|
|
21
21
|
export const getGridStyle = (styles = {}) => {
|
package/patterns/hstack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const hstackConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { justify, gap, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { justify, gap, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
|
@@ -2,16 +2,16 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const linkOverlayConfig = {
|
|
5
|
-
transform(
|
|
5
|
+
transform(props10) {
|
|
6
6
|
return {
|
|
7
7
|
_before: {
|
|
8
8
|
content: '""',
|
|
9
9
|
position: "absolute",
|
|
10
10
|
inset: "0",
|
|
11
11
|
zIndex: "0",
|
|
12
|
-
...
|
|
12
|
+
...props10["_before"]
|
|
13
13
|
},
|
|
14
|
-
...
|
|
14
|
+
...props10
|
|
15
15
|
};
|
|
16
16
|
}}
|
|
17
17
|
|
package/patterns/spacer.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const spacerConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { size, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { size, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
alignSelf: "stretch",
|
|
9
9
|
justifySelf: "stretch",
|
package/patterns/square.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const squareConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { size, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { size, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/stack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const stackConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { align, justify, direction, gap, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { align, justify, direction, gap, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexDirection: direction,
|
package/patterns/vstack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const vstackConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { justify, gap, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { justify, gap, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/wrap.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const wrapConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexWrap: "wrap",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface IconButtonVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "lg" | "md" | "sm"
|
|
10
|
+
/**
|
|
11
|
+
* @default "primary"
|
|
12
|
+
*/
|
|
13
|
+
variant: "primary" | "secondary" | "tertiary"
|
|
14
|
+
/**
|
|
15
|
+
* @default "none"
|
|
16
|
+
*/
|
|
17
|
+
severity: "none" | "danger"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type IconButtonVariantMap = {
|
|
21
|
+
[key in keyof IconButtonVariant]: Array<IconButtonVariant[key]>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type IconButtonVariantProps = {
|
|
25
|
+
[key in keyof IconButtonVariant]?: IconButtonVariant[key] | undefined
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IconButtonRecipe {
|
|
29
|
+
__type: IconButtonVariantProps
|
|
30
|
+
(props?: IconButtonVariantProps): string
|
|
31
|
+
raw: (props?: IconButtonVariantProps) => IconButtonVariantProps
|
|
32
|
+
variantMap: IconButtonVariantMap
|
|
33
|
+
variantKeys: Array<keyof IconButtonVariant>
|
|
34
|
+
splitVariantProps<Props extends IconButtonVariantProps>(props: Props): [IconButtonVariantProps, Pretty<DistributiveOmit<Props, keyof IconButtonVariantProps>>]
|
|
35
|
+
getVariantProps: (props?: IconButtonVariantProps) => IconButtonVariantProps
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The styles for the IconButton component
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
*/
|
|
43
|
+
export declare const iconButton: IconButtonRecipe
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const iconButtonFn = /* @__PURE__ */ createRecipe('icon-button', {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"variant": "primary",
|
|
7
|
+
"severity": "none"
|
|
8
|
+
}, [
|
|
9
|
+
{
|
|
10
|
+
"variant": "primary",
|
|
11
|
+
"severity": "danger",
|
|
12
|
+
"css": {
|
|
13
|
+
"bg": {
|
|
14
|
+
"_disabled": {
|
|
15
|
+
"_hover": "error.500",
|
|
16
|
+
"_active": "error.500",
|
|
17
|
+
"base": "error.500"
|
|
18
|
+
},
|
|
19
|
+
"_active": "error.800",
|
|
20
|
+
"_hover": "error.700",
|
|
21
|
+
"base": "error.500"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"variant": "secondary",
|
|
27
|
+
"severity": "danger",
|
|
28
|
+
"css": {
|
|
29
|
+
"bg": {
|
|
30
|
+
"_disabled": {
|
|
31
|
+
"_hover": "transparent",
|
|
32
|
+
"_active": "transparent",
|
|
33
|
+
"base": "transparent"
|
|
34
|
+
},
|
|
35
|
+
"_active": "error.700",
|
|
36
|
+
"_hover": "error.500",
|
|
37
|
+
"base": "transparent"
|
|
38
|
+
},
|
|
39
|
+
"boxShadow": {
|
|
40
|
+
"base": "inset 0 0 0 1px {colors.error.500}",
|
|
41
|
+
"_active": "inset 0 0 0 1px {colors.error.700}"
|
|
42
|
+
},
|
|
43
|
+
"color": {
|
|
44
|
+
"_disabled": {
|
|
45
|
+
"_hover": "error.500",
|
|
46
|
+
"_active": "error.500",
|
|
47
|
+
"base": "error.500"
|
|
48
|
+
},
|
|
49
|
+
"base": "error.500",
|
|
50
|
+
"_hover": "white",
|
|
51
|
+
"_active": "white"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"variant": "tertiary",
|
|
57
|
+
"severity": "danger",
|
|
58
|
+
"css": {
|
|
59
|
+
"bg": {
|
|
60
|
+
"_disabled": {
|
|
61
|
+
"_hover": "transparent",
|
|
62
|
+
"_active": "transparent",
|
|
63
|
+
"base": "transparent"
|
|
64
|
+
},
|
|
65
|
+
"_active": "error.200",
|
|
66
|
+
"_hover": "error.100",
|
|
67
|
+
"base": "transparent"
|
|
68
|
+
},
|
|
69
|
+
"color": {
|
|
70
|
+
"_disabled": {
|
|
71
|
+
"_hover": "error.500",
|
|
72
|
+
"_active": "error.500",
|
|
73
|
+
"base": "error.500"
|
|
74
|
+
},
|
|
75
|
+
"base": "error.500",
|
|
76
|
+
"_hover": "error.700",
|
|
77
|
+
"_active": "error.700"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
const iconButtonVariantMap = {
|
|
84
|
+
"size": [
|
|
85
|
+
"lg",
|
|
86
|
+
"md",
|
|
87
|
+
"sm"
|
|
88
|
+
],
|
|
89
|
+
"variant": [
|
|
90
|
+
"primary",
|
|
91
|
+
"secondary",
|
|
92
|
+
"tertiary"
|
|
93
|
+
],
|
|
94
|
+
"severity": [
|
|
95
|
+
"none",
|
|
96
|
+
"danger"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const iconButtonVariantKeys = Object.keys(iconButtonVariantMap)
|
|
101
|
+
|
|
102
|
+
export const iconButton = /* @__PURE__ */ Object.assign(memo(iconButtonFn.recipeFn), {
|
|
103
|
+
__recipe__: true,
|
|
104
|
+
__name__: 'iconButton',
|
|
105
|
+
__getCompoundVariantCss__: iconButtonFn.__getCompoundVariantCss__,
|
|
106
|
+
raw: (props) => props,
|
|
107
|
+
variantKeys: iconButtonVariantKeys,
|
|
108
|
+
variantMap: iconButtonVariantMap,
|
|
109
|
+
merge(recipe) {
|
|
110
|
+
return mergeRecipes(this, recipe)
|
|
111
|
+
},
|
|
112
|
+
splitVariantProps(props) {
|
|
113
|
+
return splitProps(props, iconButtonVariantKeys)
|
|
114
|
+
},
|
|
115
|
+
getVariantProps: iconButtonFn.getVariantProps,
|
|
116
|
+
})
|
package/recipes/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
export * from './button';
|
|
3
|
+
export * from './icon-button';
|
|
3
4
|
export * from './heading';
|
|
4
5
|
export * from './switch-recipe';
|
|
5
6
|
export * from './text';
|
|
@@ -20,4 +21,5 @@ export * from './tabs';
|
|
|
20
21
|
export * from './tag';
|
|
21
22
|
export * from './select';
|
|
22
23
|
export * from './chip';
|
|
23
|
-
export * from './action-card';
|
|
24
|
+
export * from './action-card';
|
|
25
|
+
export * from './tooltip';
|
package/recipes/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './button.mjs';
|
|
2
|
+
export * from './icon-button.mjs';
|
|
2
3
|
export * from './heading.mjs';
|
|
3
4
|
export * from './switch-recipe.mjs';
|
|
4
5
|
export * from './text.mjs';
|
|
@@ -19,4 +20,5 @@ export * from './tabs.mjs';
|
|
|
19
20
|
export * from './tag.mjs';
|
|
20
21
|
export * from './select.mjs';
|
|
21
22
|
export * from './chip.mjs';
|
|
22
|
-
export * from './action-card.mjs';
|
|
23
|
+
export * from './action-card.mjs';
|
|
24
|
+
export * from './tooltip.mjs';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface TooltipVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type TooltipVariantMap = {
|
|
10
|
+
[key in keyof TooltipVariant]: Array<TooltipVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type TooltipVariantProps = {
|
|
14
|
+
[key in keyof TooltipVariant]?: ConditionalValue<TooltipVariant[key]> | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TooltipRecipe {
|
|
18
|
+
__type: TooltipVariantProps
|
|
19
|
+
(props?: TooltipVariantProps): Pretty<Record<"trigger" | "arrow" | "arrowTip" | "positioner" | "content", string>>
|
|
20
|
+
raw: (props?: TooltipVariantProps) => TooltipVariantProps
|
|
21
|
+
variantMap: TooltipVariantMap
|
|
22
|
+
variantKeys: Array<keyof TooltipVariant>
|
|
23
|
+
splitVariantProps<Props extends TooltipVariantProps>(props: Props): [TooltipVariantProps, Pretty<DistributiveOmit<Props, keyof TooltipVariantProps>>]
|
|
24
|
+
getVariantProps: (props?: TooltipVariantProps) => TooltipVariantProps
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare const tooltip: TooltipRecipe
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const tooltipDefaultVariants = {}
|
|
5
|
+
const tooltipCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const tooltipSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"trigger",
|
|
10
|
+
"tooltip__trigger"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"arrow",
|
|
14
|
+
"tooltip__arrow"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"arrowTip",
|
|
18
|
+
"tooltip__arrowTip"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"positioner",
|
|
22
|
+
"tooltip__positioner"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"content",
|
|
26
|
+
"tooltip__content"
|
|
27
|
+
]
|
|
28
|
+
]
|
|
29
|
+
const tooltipSlotFns = /* @__PURE__ */ tooltipSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, tooltipDefaultVariants, getSlotCompoundVariant(tooltipCompoundVariants, slotName))])
|
|
30
|
+
|
|
31
|
+
const tooltipFn = memo((props = {}) => {
|
|
32
|
+
return Object.fromEntries(tooltipSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const tooltipVariantKeys = []
|
|
36
|
+
const getVariantProps = (variants) => ({ ...tooltipDefaultVariants, ...compact(variants) })
|
|
37
|
+
|
|
38
|
+
export const tooltip = /* @__PURE__ */ Object.assign(tooltipFn, {
|
|
39
|
+
__recipe__: false,
|
|
40
|
+
__name__: 'tooltip',
|
|
41
|
+
raw: (props) => props,
|
|
42
|
+
variantKeys: tooltipVariantKeys,
|
|
43
|
+
variantMap: {},
|
|
44
|
+
splitVariantProps(props) {
|
|
45
|
+
return splitProps(props, tooltipVariantKeys)
|
|
46
|
+
},
|
|
47
|
+
getVariantProps
|
|
48
|
+
})
|