@stokelp/styled-system 2.6.0 → 2.8.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 +8 -2
- 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/app-navigation.d.ts +35 -0
- package/recipes/app-navigation.mjs +72 -0
- package/recipes/collapsible.d.ts +28 -0
- package/recipes/collapsible.mjs +40 -0
- package/recipes/icon.d.ts +1 -1
- package/recipes/icon.mjs +1 -0
- package/recipes/index.d.ts +3 -1
- package/recipes/index.mjs +3 -1
package/package.json
CHANGED
package/panda.buildinfo.json
CHANGED
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"justifyContent]___[value:center",
|
|
50
50
|
"flex]___[value:0 0 auto",
|
|
51
51
|
"borderRadius]___[value:9999px",
|
|
52
|
+
"paddingBottom]___[value:space-24",
|
|
52
53
|
"display]___[value:grid",
|
|
53
54
|
"gridTemplateColumns]___[value:repeat(auto-fit, minmax(300px, 1fr))",
|
|
54
55
|
"gap]___[value:10px",
|
|
@@ -61,6 +62,8 @@
|
|
|
61
62
|
"marginBlock]___[value:space-24",
|
|
62
63
|
"width]___[value:100%",
|
|
63
64
|
"gridTemplateColumns]___[value:repeat(3, 1fr)",
|
|
65
|
+
"padding]___[value:space-4",
|
|
66
|
+
"gap]___[value:space-4",
|
|
64
67
|
"gap]___[value:space-32",
|
|
65
68
|
"padding]___[value:space-16",
|
|
66
69
|
"marginTop]___[value:100",
|
|
@@ -83,7 +86,6 @@
|
|
|
83
86
|
"background]___[value:grey.100",
|
|
84
87
|
"borderRadius]___[value:radius-4",
|
|
85
88
|
"display]___[value:inline-flex",
|
|
86
|
-
"gap]___[value:space-4",
|
|
87
89
|
"background]___[value:primary.700",
|
|
88
90
|
"paddingBlock]___[value:space-8",
|
|
89
91
|
"paddingInline]___[value:space-16",
|
|
@@ -153,10 +155,14 @@
|
|
|
153
155
|
"severity]___[value:warning]___[recipe:tag",
|
|
154
156
|
"severity]___[value:error]___[recipe:tag"
|
|
155
157
|
],
|
|
156
|
-
"
|
|
158
|
+
"appNavigation": [
|
|
159
|
+
"variant]___[value:primary]___[recipe:appNavigation"
|
|
160
|
+
],
|
|
157
161
|
"heading": [
|
|
158
162
|
"size]___[value:h2]___[recipe:heading"
|
|
159
163
|
],
|
|
164
|
+
"collapsible": [],
|
|
165
|
+
"productCardCatalog": [],
|
|
160
166
|
"accordion": [
|
|
161
167
|
"size]___[value:md]___[recipe:accordion"
|
|
162
168
|
],
|
|
@@ -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(props12, { map }) {
|
|
6
|
+
const { ratio = 4 / 3, ...rest } = props12;
|
|
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(props12, { map, isCssUnit, isCssVar }) {
|
|
6
|
+
const { inline, block, ...rest } = props12;
|
|
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
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const boxConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
return
|
|
5
|
+
transform(props12) {
|
|
6
|
+
return props12;
|
|
7
7
|
}}
|
|
8
8
|
|
|
9
9
|
export const getBoxStyle = (styles = {}) => {
|
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(props12) {
|
|
6
|
+
const { inline, ...rest } = props12;
|
|
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(props12) {
|
|
6
|
+
const { size, ...rest } = props12;
|
|
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(props12) {
|
|
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
|
+
...props12
|
|
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(props12) {
|
|
6
|
+
const { name, type, ...rest } = props12;
|
|
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(props12, { map }) {
|
|
6
|
+
const { orientation, thickness, color, ...rest } = props12;
|
|
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(props12) {
|
|
6
|
+
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props12;
|
|
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(props12, { map }) {
|
|
6
|
+
const { offset, offsetX, offsetY, placement, ...rest } = props12;
|
|
7
7
|
return {
|
|
8
8
|
display: "inline-flex",
|
|
9
9
|
justifyContent: "center",
|
|
@@ -38,8 +38,8 @@ transform(props11, { map }) {
|
|
|
38
38
|
...rest
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
|
-
defaultValues(
|
|
42
|
-
const offset =
|
|
41
|
+
defaultValues(props12) {
|
|
42
|
+
const offset = props12.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(props12, { map }) {
|
|
6
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props12;
|
|
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(props12, { map, isCssUnit }) {
|
|
6
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props12;
|
|
7
7
|
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
display: "grid",
|
|
@@ -14,8 +14,8 @@ transform(props11, { map, isCssUnit }) {
|
|
|
14
14
|
...rest
|
|
15
15
|
};
|
|
16
16
|
},
|
|
17
|
-
defaultValues(
|
|
18
|
-
return { gap:
|
|
17
|
+
defaultValues(props12) {
|
|
18
|
+
return { gap: props12.columnGap || props12.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(props12) {
|
|
6
|
+
const { justify, gap, ...rest } = props12;
|
|
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(props12) {
|
|
6
6
|
return {
|
|
7
7
|
_before: {
|
|
8
8
|
content: '""',
|
|
9
9
|
position: "absolute",
|
|
10
10
|
inset: "0",
|
|
11
11
|
zIndex: "0",
|
|
12
|
-
...
|
|
12
|
+
...props12["_before"]
|
|
13
13
|
},
|
|
14
|
-
...
|
|
14
|
+
...props12
|
|
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(props12, { map }) {
|
|
6
|
+
const { size, ...rest } = props12;
|
|
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(props12) {
|
|
6
|
+
const { size, ...rest } = props12;
|
|
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(props12) {
|
|
6
|
+
const { align, justify, direction, gap, ...rest } = props12;
|
|
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(props12) {
|
|
6
|
+
const { justify, gap, ...rest } = props12;
|
|
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(props12) {
|
|
6
|
+
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props12;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexWrap: "wrap",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface AppNavigationVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "primary"
|
|
8
|
+
*/
|
|
9
|
+
variant: "primary"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type AppNavigationVariantMap = {
|
|
13
|
+
[key in keyof AppNavigationVariant]: Array<AppNavigationVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type AppNavigationVariantProps = {
|
|
17
|
+
[key in keyof AppNavigationVariant]?: ConditionalValue<AppNavigationVariant[key]> | undefined
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AppNavigationRecipe {
|
|
21
|
+
__type: AppNavigationVariantProps
|
|
22
|
+
(props?: AppNavigationVariantProps): Pretty<Record<"root" | "header" | "body" | "item" | "itemLabel" | "itemIcon" | "itemContent" | "itemSubItems" | "footer", string>>
|
|
23
|
+
raw: (props?: AppNavigationVariantProps) => AppNavigationVariantProps
|
|
24
|
+
variantMap: AppNavigationVariantMap
|
|
25
|
+
variantKeys: Array<keyof AppNavigationVariant>
|
|
26
|
+
splitVariantProps<Props extends AppNavigationVariantProps>(props: Props): [AppNavigationVariantProps, Pretty<DistributiveOmit<Props, keyof AppNavigationVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: AppNavigationVariantProps) => AppNavigationVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The styles for the AppNavigation component
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
*/
|
|
35
|
+
export declare const appNavigation: AppNavigationRecipe
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const appNavigationDefaultVariants = {
|
|
5
|
+
"variant": "primary"
|
|
6
|
+
}
|
|
7
|
+
const appNavigationCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const appNavigationSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"app-navigation__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"header",
|
|
16
|
+
"app-navigation__header"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"body",
|
|
20
|
+
"app-navigation__body"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"item",
|
|
24
|
+
"app-navigation__item"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"itemLabel",
|
|
28
|
+
"app-navigation__itemLabel"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"itemIcon",
|
|
32
|
+
"app-navigation__itemIcon"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"itemContent",
|
|
36
|
+
"app-navigation__itemContent"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"itemSubItems",
|
|
40
|
+
"app-navigation__itemSubItems"
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"footer",
|
|
44
|
+
"app-navigation__footer"
|
|
45
|
+
]
|
|
46
|
+
]
|
|
47
|
+
const appNavigationSlotFns = /* @__PURE__ */ appNavigationSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, appNavigationDefaultVariants, getSlotCompoundVariant(appNavigationCompoundVariants, slotName))])
|
|
48
|
+
|
|
49
|
+
const appNavigationFn = memo((props = {}) => {
|
|
50
|
+
return Object.fromEntries(appNavigationSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const appNavigationVariantKeys = [
|
|
54
|
+
"variant"
|
|
55
|
+
]
|
|
56
|
+
const getVariantProps = (variants) => ({ ...appNavigationDefaultVariants, ...compact(variants) })
|
|
57
|
+
|
|
58
|
+
export const appNavigation = /* @__PURE__ */ Object.assign(appNavigationFn, {
|
|
59
|
+
__recipe__: false,
|
|
60
|
+
__name__: 'appNavigation',
|
|
61
|
+
raw: (props) => props,
|
|
62
|
+
variantKeys: appNavigationVariantKeys,
|
|
63
|
+
variantMap: {
|
|
64
|
+
"variant": [
|
|
65
|
+
"primary"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
splitVariantProps(props) {
|
|
69
|
+
return splitProps(props, appNavigationVariantKeys)
|
|
70
|
+
},
|
|
71
|
+
getVariantProps
|
|
72
|
+
})
|
|
@@ -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 CollapsibleVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type CollapsibleVariantMap = {
|
|
10
|
+
[key in keyof CollapsibleVariant]: Array<CollapsibleVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type CollapsibleVariantProps = {
|
|
14
|
+
[key in keyof CollapsibleVariant]?: ConditionalValue<CollapsibleVariant[key]> | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CollapsibleRecipe {
|
|
18
|
+
__type: CollapsibleVariantProps
|
|
19
|
+
(props?: CollapsibleVariantProps): Pretty<Record<"root" | "trigger" | "content", string>>
|
|
20
|
+
raw: (props?: CollapsibleVariantProps) => CollapsibleVariantProps
|
|
21
|
+
variantMap: CollapsibleVariantMap
|
|
22
|
+
variantKeys: Array<keyof CollapsibleVariant>
|
|
23
|
+
splitVariantProps<Props extends CollapsibleVariantProps>(props: Props): [CollapsibleVariantProps, Pretty<DistributiveOmit<Props, keyof CollapsibleVariantProps>>]
|
|
24
|
+
getVariantProps: (props?: CollapsibleVariantProps) => CollapsibleVariantProps
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare const collapsible: CollapsibleRecipe
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const collapsibleDefaultVariants = {}
|
|
5
|
+
const collapsibleCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const collapsibleSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"root",
|
|
10
|
+
"collapsible__root"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"trigger",
|
|
14
|
+
"collapsible__trigger"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"content",
|
|
18
|
+
"collapsible__content"
|
|
19
|
+
]
|
|
20
|
+
]
|
|
21
|
+
const collapsibleSlotFns = /* @__PURE__ */ collapsibleSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, collapsibleDefaultVariants, getSlotCompoundVariant(collapsibleCompoundVariants, slotName))])
|
|
22
|
+
|
|
23
|
+
const collapsibleFn = memo((props = {}) => {
|
|
24
|
+
return Object.fromEntries(collapsibleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const collapsibleVariantKeys = []
|
|
28
|
+
const getVariantProps = (variants) => ({ ...collapsibleDefaultVariants, ...compact(variants) })
|
|
29
|
+
|
|
30
|
+
export const collapsible = /* @__PURE__ */ Object.assign(collapsibleFn, {
|
|
31
|
+
__recipe__: false,
|
|
32
|
+
__name__: 'collapsible',
|
|
33
|
+
raw: (props) => props,
|
|
34
|
+
variantKeys: collapsibleVariantKeys,
|
|
35
|
+
variantMap: {},
|
|
36
|
+
splitVariantProps(props) {
|
|
37
|
+
return splitProps(props, collapsibleVariantKeys)
|
|
38
|
+
},
|
|
39
|
+
getVariantProps
|
|
40
|
+
})
|
package/recipes/icon.d.ts
CHANGED
package/recipes/icon.mjs
CHANGED
package/recipes/index.d.ts
CHANGED
|
@@ -40,4 +40,6 @@ export * from './product-card-catalog';
|
|
|
40
40
|
export * from './switch-card';
|
|
41
41
|
export * from './radio-card-group';
|
|
42
42
|
export * from './checkbox-card';
|
|
43
|
-
export * from './combobox';
|
|
43
|
+
export * from './combobox';
|
|
44
|
+
export * from './collapsible';
|
|
45
|
+
export * from './app-navigation';
|
package/recipes/index.mjs
CHANGED
|
@@ -39,4 +39,6 @@ export * from './product-card-catalog.mjs';
|
|
|
39
39
|
export * from './switch-card.mjs';
|
|
40
40
|
export * from './radio-card-group.mjs';
|
|
41
41
|
export * from './checkbox-card.mjs';
|
|
42
|
-
export * from './combobox.mjs';
|
|
42
|
+
export * from './combobox.mjs';
|
|
43
|
+
export * from './collapsible.mjs';
|
|
44
|
+
export * from './app-navigation.mjs';
|