@traefik-labs/faency 12.0.7 → 12.0.9
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/README.md +6 -5
- package/dist/components/AccessibleIcon/AccessibleIcon.vanilla.cjs +23 -0
- package/dist/components/AccessibleIcon/AccessibleIcon.vanilla.cjs.map +1 -0
- package/dist/components/AccessibleIcon/AccessibleIcon.vanilla.js +6 -0
- package/dist/components/AccessibleIcon/AccessibleIcon.vanilla.js.map +1 -0
- package/dist/components/Avatar/Avatar.vanilla.cjs +42 -0
- package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.vanilla.css.cjs +11 -0
- package/dist/components/Avatar/Avatar.vanilla.css.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.vanilla.css.js +11 -0
- package/dist/components/Avatar/Avatar.vanilla.css.js.map +1 -0
- package/dist/components/Avatar/Avatar.vanilla.js +25 -0
- package/dist/components/Avatar/Avatar.vanilla.js.map +1 -0
- package/dist/components/Bubble/Bubble.vanilla.cjs +34 -0
- package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -0
- package/dist/components/Bubble/Bubble.vanilla.css.cjs +7 -0
- package/dist/components/Bubble/Bubble.vanilla.css.cjs.map +1 -0
- package/dist/components/Bubble/Bubble.vanilla.css.js +7 -0
- package/dist/components/Bubble/Bubble.vanilla.css.js.map +1 -0
- package/dist/components/Bubble/Bubble.vanilla.js +34 -0
- package/dist/components/Bubble/Bubble.vanilla.js.map +1 -0
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +72 -36
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +72 -36
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
- package/dist/components/Card/Card.vanilla.cjs +20 -18
- package/dist/components/Card/Card.vanilla.cjs.map +1 -1
- package/dist/components/Card/Card.vanilla.css.cjs +0 -1
- package/dist/components/Card/Card.vanilla.css.cjs.map +1 -1
- package/dist/components/Card/Card.vanilla.css.js +0 -1
- package/dist/components/Card/Card.vanilla.css.js.map +1 -1
- package/dist/components/Card/Card.vanilla.js +20 -18
- package/dist/components/Card/Card.vanilla.js.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.cjs +6 -4
- package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.js +6 -4
- package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
- package/dist/components/Image/Image.vanilla.cjs +33 -0
- package/dist/components/Image/Image.vanilla.cjs.map +1 -0
- package/dist/components/Image/Image.vanilla.css.cjs +6 -0
- package/dist/components/Image/Image.vanilla.css.cjs.map +1 -0
- package/dist/components/Image/Image.vanilla.css.js +6 -0
- package/dist/components/Image/Image.vanilla.css.js.map +1 -0
- package/dist/components/Image/Image.vanilla.js +33 -0
- package/dist/components/Image/Image.vanilla.js.map +1 -0
- package/dist/components/Input/Input.vanilla.css.cjs +1 -0
- package/dist/components/Input/Input.vanilla.css.cjs.map +1 -1
- package/dist/components/Input/Input.vanilla.css.js +1 -0
- package/dist/components/Input/Input.vanilla.css.js.map +1 -1
- package/dist/components/Label/Label.vanilla.cjs +18 -22
- package/dist/components/Label/Label.vanilla.cjs.map +1 -1
- package/dist/components/Label/Label.vanilla.css.cjs +1 -0
- package/dist/components/Label/Label.vanilla.css.cjs.map +1 -1
- package/dist/components/Label/Label.vanilla.css.js +1 -0
- package/dist/components/Label/Label.vanilla.css.js.map +1 -1
- package/dist/components/Label/Label.vanilla.js +18 -5
- package/dist/components/Label/Label.vanilla.js.map +1 -1
- package/dist/components/Panel/Panel.vanilla.cjs +6 -4
- package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
- package/dist/components/Panel/Panel.vanilla.js +6 -4
- package/dist/components/Panel/Panel.vanilla.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.cjs +34 -0
- package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.vanilla.css.cjs +7 -0
- package/dist/components/Skeleton/Skeleton.vanilla.css.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.vanilla.css.js +7 -0
- package/dist/components/Skeleton/Skeleton.vanilla.css.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.vanilla.js +34 -0
- package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -0
- package/dist/faency.css +1357 -1050
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +267 -24
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/styles/themes.css.cjs +1 -0
- package/dist/styles/themes.css.cjs.map +1 -1
- package/dist/styles/themes.css.js +1 -0
- package/dist/styles/themes.css.js.map +1 -1
- package/package.json +8 -9
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This is the React component library and design system for [Traefik Labs](https://traefik.io).
|
|
4
4
|
|
|
5
|
-
Built with React, Typescript, [Stitches](https://github.com/modulz/stitches) and [Radix UI Primitives](https://radix-ui.com/primitives/docs/overview/introduction).
|
|
5
|
+
Built with React, Typescript, [Stitches](https://github.com/modulz/stitches), [vanilla-extract](https://vanilla-extract.style/) (migration in progress), and [Radix UI Primitives](https://radix-ui.com/primitives/docs/overview/introduction).
|
|
6
6
|
|
|
7
7
|
## Demo (Storybook)
|
|
8
8
|
|
|
@@ -46,9 +46,9 @@ const Container = styled(Flex, {
|
|
|
46
46
|
const MyComponent = () => <Container>{children}</Container>;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
#### Using Vanilla Extract Components (
|
|
49
|
+
#### Using Vanilla Extract Components (Migration in Progress)
|
|
50
50
|
|
|
51
|
-
For better performance with static CSS, use the new Vanilla Extract components
|
|
51
|
+
For better performance with static CSS, you can use the new Vanilla Extract components (many components are available, more being migrated).
|
|
52
52
|
|
|
53
53
|
1. Import the CSS file in your app's entry point:
|
|
54
54
|
|
|
@@ -57,6 +57,7 @@ import '@traefik-labs/faency/dist/style.css';
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
2. Wrap your app with the VanillaExtractThemeProvider:
|
|
60
|
+
Wrap your app with the VanillaExtractThemeProvider:
|
|
60
61
|
|
|
61
62
|
```jsx
|
|
62
63
|
import { VanillaExtractThemeProvider } from '@traefik-labs/faency';
|
|
@@ -71,11 +72,11 @@ const App = () => (
|
|
|
71
72
|
);
|
|
72
73
|
```
|
|
73
74
|
|
|
74
|
-
> **Note**: Vanilla Extract components use static CSS generated at build time, providing better performance than runtime CSS-in-JS. Components with the `Vanilla` suffix (e.g., `BadgeVanilla`, `BoxVanilla`)
|
|
75
|
+
> **Note**: Vanilla Extract components use static CSS generated at build time, providing better performance than runtime CSS-in-JS. CSS is automatically included when you import components - no separate CSS import needed. Components with the `Vanilla` suffix (e.g., `BadgeVanilla`, `BoxVanilla`) are available. Not all components have Vanilla Extract versions yet - check the component documentation or use the Stitches version if a Vanilla version is not available.
|
|
75
76
|
|
|
76
77
|
## How to contribute
|
|
77
78
|
|
|
78
|
-
- Make sure you have Node
|
|
79
|
+
- Make sure you have Node 20+, or if you prefer, you can work in a Docker container:
|
|
79
80
|
|
|
80
81
|
```sh
|
|
81
82
|
docker run -it -v $(pwd):/usr/local/src/ -w /usr/local/src/ -p 3000:3000 node:latest bash
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const AccessibleIconPrimitive = require("@radix-ui/react-accessible-icon");
|
|
4
|
+
function _interopNamespaceDefault(e) {
|
|
5
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
6
|
+
if (e) {
|
|
7
|
+
for (const k in e) {
|
|
8
|
+
if (k !== "default") {
|
|
9
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: () => e[k]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return Object.freeze(n);
|
|
19
|
+
}
|
|
20
|
+
const AccessibleIconPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AccessibleIconPrimitive);
|
|
21
|
+
const AccessibleIconVanilla = AccessibleIconPrimitive__namespace.Root;
|
|
22
|
+
exports.AccessibleIconVanilla = AccessibleIconVanilla;
|
|
23
|
+
//# sourceMappingURL=AccessibleIcon.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessibleIcon.vanilla.cjs","sources":["../../../components/AccessibleIcon/AccessibleIcon.vanilla.tsx"],"sourcesContent":["import * as AccessibleIconPrimitive from '@radix-ui/react-accessible-icon';\n\nexport const AccessibleIconVanilla = AccessibleIconPrimitive.Root;\n"],"names":["AccessibleIconPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEO,MAAM,wBAAwBA,mCAAwB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessibleIcon.vanilla.js","sources":["../../../components/AccessibleIcon/AccessibleIcon.vanilla.tsx"],"sourcesContent":["import * as AccessibleIconPrimitive from '@radix-ui/react-accessible-icon';\n\nexport const AccessibleIconVanilla = AccessibleIconPrimitive.Root;\n"],"names":[],"mappings":";AAEO,MAAM,wBAAwB,wBAAwB;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const AvatarPrimitive = require("@radix-ui/react-avatar");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const Box_vanilla = require("../Box/Box.vanilla.cjs");
|
|
7
|
+
const Avatar_vanilla_css = require("./Avatar.vanilla.css.cjs");
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== "default") {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
const AvatarPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AvatarPrimitive);
|
|
25
|
+
const AvatarVanillaComponent = React.forwardRef(({ alt, src, fallback, size, variant, shape, css, style, ...props }, ref) => {
|
|
26
|
+
const recipeClass = Avatar_vanilla_css.avatarRecipe({ size, variant, shape });
|
|
27
|
+
const fallbackRecipeClass = Avatar_vanilla_css.avatarFallbackRecipe({ size });
|
|
28
|
+
const wrapperCss = {
|
|
29
|
+
...css,
|
|
30
|
+
position: "relative",
|
|
31
|
+
height: "fit-content",
|
|
32
|
+
width: "fit-content"
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box_vanilla.BoxVanilla, { css: wrapperCss, style, children: /* @__PURE__ */ jsxRuntime.jsxs(AvatarPrimitive__namespace.Root, { ref, className: recipeClass, ...props, children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvatarPrimitive__namespace.Image, { className: Avatar_vanilla_css.avatarImage, alt, src }),
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvatarPrimitive__namespace.Fallback, { className: fallbackRecipeClass, children: fallback })
|
|
37
|
+
] }) });
|
|
38
|
+
});
|
|
39
|
+
AvatarVanillaComponent.displayName = "AvatarVanilla";
|
|
40
|
+
const AvatarVanilla = AvatarVanillaComponent;
|
|
41
|
+
exports.AvatarVanilla = AvatarVanilla;
|
|
42
|
+
//# sourceMappingURL=Avatar.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.vanilla.cjs","sources":["../../../components/Avatar/Avatar.vanilla.tsx"],"sourcesContent":["import * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, { forwardRef } from 'react';\n\nimport { CSSProps } from '../../styles/cssProps';\nimport { BoxVanilla } from '../Box/Box.vanilla';\nimport { avatarFallbackRecipe, avatarImage, avatarRecipe } from './Avatar.vanilla.css';\n\ntype AvatarRecipeVariants = NonNullable<RecipeVariants<typeof avatarRecipe>>;\n\ninterface AvatarOwnProps extends AvatarRecipeVariants, CSSProps {\n alt?: string;\n src?: string;\n fallback?: React.ReactNode;\n}\n\nexport type AvatarVanillaProps = Omit<\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n keyof AvatarOwnProps\n> &\n AvatarOwnProps;\n\nconst AvatarVanillaComponent = forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n AvatarVanillaProps\n>(({ alt, src, fallback, size, variant, shape, css, style, ...props }, ref) => {\n const recipeClass = avatarRecipe({ size, variant, shape });\n const fallbackRecipeClass = avatarFallbackRecipe({ size });\n\n // This CSS will be processed by the Box component\n const wrapperCss = {\n ...css,\n position: 'relative' as const,\n height: 'fit-content' as const,\n width: 'fit-content' as const,\n };\n\n return (\n <BoxVanilla css={wrapperCss} style={style}>\n <AvatarPrimitive.Root ref={ref} className={recipeClass} {...props}>\n <AvatarPrimitive.Image className={avatarImage} alt={alt} src={src} />\n <AvatarPrimitive.Fallback className={fallbackRecipeClass}>\n {fallback}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n </BoxVanilla>\n );\n});\n\nAvatarVanillaComponent.displayName = 'AvatarVanilla';\n\nexport const AvatarVanilla = AvatarVanillaComponent;\n"],"names":["forwardRef","avatarRecipe","avatarFallbackRecipe","jsx","BoxVanilla","jsxs","AvatarPrimitive","avatarImage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,yBAAyBA,MAAAA,WAG7B,CAAC,EAAE,KAAK,KAAK,UAAU,MAAM,SAAS,OAAO,KAAK,OAAO,GAAG,MAAA,GAAS,QAAQ;AAC7E,QAAM,cAAcC,mBAAAA,aAAa,EAAE,MAAM,SAAS,OAAO;AACzD,QAAM,sBAAsBC,mBAAAA,qBAAqB,EAAE,MAAM;AAGzD,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAGT,SACEC,2BAAAA,IAACC,YAAAA,YAAA,EAAW,KAAK,YAAY,OAC3B,UAAAC,2BAAAA,KAACC,2BAAgB,MAAhB,EAAqB,KAAU,WAAW,aAAc,GAAG,OAC1D,UAAA;AAAA,IAAAH,2BAAAA,IAACG,2BAAgB,OAAhB,EAAsB,WAAWC,gCAAa,KAAU,KAAU;AAAA,mCAClED,2BAAgB,UAAhB,EAAyB,WAAW,qBAClC,UAAA,SAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;AAE9B,MAAM,gBAAgB;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
;/* empty css */
|
|
4
|
+
const createRuntimeFn62c9670f_esm = require("../../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.cjs");
|
|
5
|
+
var avatarRecipe = createRuntimeFn62c9670f_esm.c({ defaultClassName: "_7on54e1 _7on54e0", variantClassNames: { size: { "1": "_7on54e2", "2": "_7on54e3", "3": "_7on54e4", "4": "_7on54e5", "5": "_7on54e6", "6": "_7on54e7" }, variant: { gray: "_7on54e8", red: "_7on54e9", purple: "_7on54ea", blue: "_7on54eb", green: "_7on54ec", orange: "_7on54ed" }, shape: { square: "_7on54ee", circle: "_7on54ef" } }, defaultVariants: { size: "2", variant: "gray", shape: "circle" }, compoundVariants: [] });
|
|
6
|
+
var avatarImage = "_7on54eg";
|
|
7
|
+
var avatarFallbackRecipe = createRuntimeFn62c9670f_esm.c({ defaultClassName: "_7on54ei _7on54eh", variantClassNames: { size: { "1": "_7on54ej", "2": "_7on54ek", "3": "_7on54el", "4": "_7on54em", "5": "_7on54en", "6": "_7on54eo" } }, defaultVariants: { size: "2" }, compoundVariants: [] });
|
|
8
|
+
exports.avatarFallbackRecipe = avatarFallbackRecipe;
|
|
9
|
+
exports.avatarImage = avatarImage;
|
|
10
|
+
exports.avatarRecipe = avatarRecipe;
|
|
11
|
+
//# sourceMappingURL=Avatar.vanilla.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.vanilla.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { c as createRuntimeFn } from "../../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
|
|
3
|
+
var avatarRecipe = createRuntimeFn({ defaultClassName: "_7on54e1 _7on54e0", variantClassNames: { size: { "1": "_7on54e2", "2": "_7on54e3", "3": "_7on54e4", "4": "_7on54e5", "5": "_7on54e6", "6": "_7on54e7" }, variant: { gray: "_7on54e8", red: "_7on54e9", purple: "_7on54ea", blue: "_7on54eb", green: "_7on54ec", orange: "_7on54ed" }, shape: { square: "_7on54ee", circle: "_7on54ef" } }, defaultVariants: { size: "2", variant: "gray", shape: "circle" }, compoundVariants: [] });
|
|
4
|
+
var avatarImage = "_7on54eg";
|
|
5
|
+
var avatarFallbackRecipe = createRuntimeFn({ defaultClassName: "_7on54ei _7on54eh", variantClassNames: { size: { "1": "_7on54ej", "2": "_7on54ek", "3": "_7on54el", "4": "_7on54em", "5": "_7on54en", "6": "_7on54eo" } }, defaultVariants: { size: "2" }, compoundVariants: [] });
|
|
6
|
+
export {
|
|
7
|
+
avatarFallbackRecipe,
|
|
8
|
+
avatarImage,
|
|
9
|
+
avatarRecipe
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Avatar.vanilla.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.vanilla.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { BoxVanilla } from "../Box/Box.vanilla.js";
|
|
5
|
+
import { avatarRecipe, avatarFallbackRecipe, avatarImage } from "./Avatar.vanilla.css.js";
|
|
6
|
+
const AvatarVanillaComponent = forwardRef(({ alt, src, fallback, size, variant, shape, css, style, ...props }, ref) => {
|
|
7
|
+
const recipeClass = avatarRecipe({ size, variant, shape });
|
|
8
|
+
const fallbackRecipeClass = avatarFallbackRecipe({ size });
|
|
9
|
+
const wrapperCss = {
|
|
10
|
+
...css,
|
|
11
|
+
position: "relative",
|
|
12
|
+
height: "fit-content",
|
|
13
|
+
width: "fit-content"
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ jsx(BoxVanilla, { css: wrapperCss, style, children: /* @__PURE__ */ jsxs(AvatarPrimitive.Root, { ref, className: recipeClass, ...props, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(AvatarPrimitive.Image, { className: avatarImage, alt, src }),
|
|
17
|
+
/* @__PURE__ */ jsx(AvatarPrimitive.Fallback, { className: fallbackRecipeClass, children: fallback })
|
|
18
|
+
] }) });
|
|
19
|
+
});
|
|
20
|
+
AvatarVanillaComponent.displayName = "AvatarVanilla";
|
|
21
|
+
const AvatarVanilla = AvatarVanillaComponent;
|
|
22
|
+
export {
|
|
23
|
+
AvatarVanilla
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Avatar.vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.vanilla.js","sources":["../../../components/Avatar/Avatar.vanilla.tsx"],"sourcesContent":["import * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, { forwardRef } from 'react';\n\nimport { CSSProps } from '../../styles/cssProps';\nimport { BoxVanilla } from '../Box/Box.vanilla';\nimport { avatarFallbackRecipe, avatarImage, avatarRecipe } from './Avatar.vanilla.css';\n\ntype AvatarRecipeVariants = NonNullable<RecipeVariants<typeof avatarRecipe>>;\n\ninterface AvatarOwnProps extends AvatarRecipeVariants, CSSProps {\n alt?: string;\n src?: string;\n fallback?: React.ReactNode;\n}\n\nexport type AvatarVanillaProps = Omit<\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n keyof AvatarOwnProps\n> &\n AvatarOwnProps;\n\nconst AvatarVanillaComponent = forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n AvatarVanillaProps\n>(({ alt, src, fallback, size, variant, shape, css, style, ...props }, ref) => {\n const recipeClass = avatarRecipe({ size, variant, shape });\n const fallbackRecipeClass = avatarFallbackRecipe({ size });\n\n // This CSS will be processed by the Box component\n const wrapperCss = {\n ...css,\n position: 'relative' as const,\n height: 'fit-content' as const,\n width: 'fit-content' as const,\n };\n\n return (\n <BoxVanilla css={wrapperCss} style={style}>\n <AvatarPrimitive.Root ref={ref} className={recipeClass} {...props}>\n <AvatarPrimitive.Image className={avatarImage} alt={alt} src={src} />\n <AvatarPrimitive.Fallback className={fallbackRecipeClass}>\n {fallback}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n </BoxVanilla>\n );\n});\n\nAvatarVanillaComponent.displayName = 'AvatarVanilla';\n\nexport const AvatarVanilla = AvatarVanillaComponent;\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,yBAAyB,WAG7B,CAAC,EAAE,KAAK,KAAK,UAAU,MAAM,SAAS,OAAO,KAAK,OAAO,GAAG,MAAA,GAAS,QAAQ;AAC7E,QAAM,cAAc,aAAa,EAAE,MAAM,SAAS,OAAO;AACzD,QAAM,sBAAsB,qBAAqB,EAAE,MAAM;AAGzD,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAGT,SACE,oBAAC,YAAA,EAAW,KAAK,YAAY,OAC3B,UAAA,qBAAC,gBAAgB,MAAhB,EAAqB,KAAU,WAAW,aAAc,GAAG,OAC1D,UAAA;AAAA,IAAA,oBAAC,gBAAgB,OAAhB,EAAsB,WAAW,aAAa,KAAU,KAAU;AAAA,wBAClE,gBAAgB,UAAhB,EAAyB,WAAW,qBAClC,UAAA,SAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;AAE9B,MAAM,gBAAgB;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const dynamic = require("@vanilla-extract/dynamic");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cssProps = require("../../styles/cssProps.cjs");
|
|
7
|
+
const themeContext = require("../../styles/themeContext.cjs");
|
|
8
|
+
const Bubble_vanilla_css = require("./Bubble.vanilla.css.cjs");
|
|
9
|
+
const BubbleVanillaComponentImpl = React.forwardRef(
|
|
10
|
+
({ as, className, css, style, size, variant, noAnimation, ...props }, ref) => {
|
|
11
|
+
const Component = as || "div";
|
|
12
|
+
const { colors } = themeContext.useVanillaExtractTheme();
|
|
13
|
+
const { style: cssStyles, vars } = cssProps.processCSSProp(css, colors);
|
|
14
|
+
const mergedStyles = {
|
|
15
|
+
...cssStyles,
|
|
16
|
+
...style,
|
|
17
|
+
...dynamic.assignInlineVars(vars)
|
|
18
|
+
};
|
|
19
|
+
const recipeClass = Bubble_vanilla_css.bubbleRecipe({ size, variant, noAnimation });
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21
|
+
Component,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: `${recipeClass} ${className || ""}`.trim(),
|
|
25
|
+
style: mergedStyles,
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
BubbleVanillaComponentImpl.displayName = "BubbleVanilla";
|
|
32
|
+
const BubbleVanilla = BubbleVanillaComponentImpl;
|
|
33
|
+
exports.BubbleVanilla = BubbleVanilla;
|
|
34
|
+
//# sourceMappingURL=Bubble.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bubble.vanilla.cjs","sources":["../../../components/Bubble/Bubble.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { bubbleRecipe } from './Bubble.vanilla.css';\n\ntype BubbleRecipeVariants = NonNullable<RecipeVariants<typeof bubbleRecipe>>;\n\ninterface BubbleOwnProps extends BubbleRecipeVariants, CSSProps {}\n\nexport type BubbleVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n BubbleOwnProps\n>;\n\ntype BubbleVanillaComponent = PolymorphicComponent<'div', BubbleVanillaProps<ElementType>>;\n\nconst BubbleVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, variant, noAnimation, ...props }: BubbleVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = bubbleRecipe({ size, variant, noAnimation });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nBubbleVanillaComponentImpl.displayName = 'BubbleVanilla';\n\nexport const BubbleVanilla = BubbleVanillaComponentImpl as BubbleVanillaComponent;\n"],"names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","bubbleRecipe","jsx"],"mappings":";;;;;;;;AAwBA,MAAM,6BAA6BA,MAAAA;AAAAA,EACjC,CACE,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,aAAa,GAAG,MAAA,GAC5D,QACG;AACH,UAAM,YAAY,MAAM;AAExB,UAAM,EAAE,OAAA,IAAWC,oCAAA;AAEnB,UAAM,EAAE,OAAO,WAAW,SAASC,SAAAA,eAAe,KAAK,MAAM;AAE7D,UAAM,eAAe;AAAA,MACnB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAGC,QAAAA,iBAAiB,IAAI;AAAA,IAAA;AAG1B,UAAM,cAAcC,mBAAAA,aAAa,EAAE,MAAM,SAAS,aAAa;AAE/D,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,WAAW,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,QAC/C,OAAO;AAAA,QACN,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,2BAA2B,cAAc;AAElC,MAAM,gBAAgB;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
;/* empty css */
|
|
4
|
+
const createRuntimeFn62c9670f_esm = require("../../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.cjs");
|
|
5
|
+
var bubbleRecipe = createRuntimeFn62c9670f_esm.c({ defaultClassName: "_1fnlquw2 _1fnlquw1", variantClassNames: { variant: { red: "_1fnlquw3", green: "_1fnlquw4", orange: "_1fnlquw5", blue: "_1fnlquw6", yellow: "_1fnlquw7", purple: "_1fnlquw8", gray: "_1fnlquw9" }, size: { "x-small": "_1fnlquwa", small: "_1fnlquwb", medium: "_1fnlquwc", large: "_1fnlquwd", "x-large": "_1fnlquwe" }, noAnimation: { true: "_1fnlquwf" } }, defaultVariants: { size: "small", noAnimation: false }, compoundVariants: [] });
|
|
6
|
+
exports.bubbleRecipe = bubbleRecipe;
|
|
7
|
+
//# sourceMappingURL=Bubble.vanilla.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bubble.vanilla.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { c as createRuntimeFn } from "../../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
|
|
3
|
+
var bubbleRecipe = createRuntimeFn({ defaultClassName: "_1fnlquw2 _1fnlquw1", variantClassNames: { variant: { red: "_1fnlquw3", green: "_1fnlquw4", orange: "_1fnlquw5", blue: "_1fnlquw6", yellow: "_1fnlquw7", purple: "_1fnlquw8", gray: "_1fnlquw9" }, size: { "x-small": "_1fnlquwa", small: "_1fnlquwb", medium: "_1fnlquwc", large: "_1fnlquwd", "x-large": "_1fnlquwe" }, noAnimation: { true: "_1fnlquwf" } }, defaultVariants: { size: "small", noAnimation: false }, compoundVariants: [] });
|
|
4
|
+
export {
|
|
5
|
+
bubbleRecipe
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=Bubble.vanilla.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bubble.vanilla.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { processCSSProp } from "../../styles/cssProps.js";
|
|
5
|
+
import { useVanillaExtractTheme } from "../../styles/themeContext.js";
|
|
6
|
+
import { bubbleRecipe } from "./Bubble.vanilla.css.js";
|
|
7
|
+
const BubbleVanillaComponentImpl = forwardRef(
|
|
8
|
+
({ as, className, css, style, size, variant, noAnimation, ...props }, ref) => {
|
|
9
|
+
const Component = as || "div";
|
|
10
|
+
const { colors } = useVanillaExtractTheme();
|
|
11
|
+
const { style: cssStyles, vars } = processCSSProp(css, colors);
|
|
12
|
+
const mergedStyles = {
|
|
13
|
+
...cssStyles,
|
|
14
|
+
...style,
|
|
15
|
+
...assignInlineVars(vars)
|
|
16
|
+
};
|
|
17
|
+
const recipeClass = bubbleRecipe({ size, variant, noAnimation });
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Component,
|
|
20
|
+
{
|
|
21
|
+
ref,
|
|
22
|
+
className: `${recipeClass} ${className || ""}`.trim(),
|
|
23
|
+
style: mergedStyles,
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
BubbleVanillaComponentImpl.displayName = "BubbleVanilla";
|
|
30
|
+
const BubbleVanilla = BubbleVanillaComponentImpl;
|
|
31
|
+
export {
|
|
32
|
+
BubbleVanilla
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Bubble.vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bubble.vanilla.js","sources":["../../../components/Bubble/Bubble.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { bubbleRecipe } from './Bubble.vanilla.css';\n\ntype BubbleRecipeVariants = NonNullable<RecipeVariants<typeof bubbleRecipe>>;\n\ninterface BubbleOwnProps extends BubbleRecipeVariants, CSSProps {}\n\nexport type BubbleVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n BubbleOwnProps\n>;\n\ntype BubbleVanillaComponent = PolymorphicComponent<'div', BubbleVanillaProps<ElementType>>;\n\nconst BubbleVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, size, variant, noAnimation, ...props }: BubbleVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = bubbleRecipe({ size, variant, noAnimation });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nBubbleVanillaComponentImpl.displayName = 'BubbleVanilla';\n\nexport const BubbleVanilla = BubbleVanillaComponentImpl as BubbleVanillaComponent;\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,6BAA6B;AAAA,EACjC,CACE,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,aAAa,GAAG,MAAA,GAC5D,QACG;AACH,UAAM,YAAY,MAAM;AAExB,UAAM,EAAE,OAAA,IAAW,uBAAA;AAEnB,UAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;AAE7D,UAAM,eAAe;AAAA,MACnB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG,iBAAiB,IAAI;AAAA,IAAA;AAG1B,UAAM,cAAc,aAAa,EAAE,MAAM,SAAS,aAAa;AAE/D,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,WAAW,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,QAC/C,OAAO;AAAA,QACN,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,2BAA2B,cAAc;AAElC,MAAM,gBAAgB;"}
|
|
@@ -24,44 +24,80 @@ function _interopNamespaceDefault(e) {
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
const ToggleGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(ToggleGroupPrimitive);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
const ButtonSwitchContainerVanillaImpl = React.forwardRef(
|
|
28
|
+
({ as, className, css, style, children, ...props }, ref) => {
|
|
29
|
+
const Component = as || "div";
|
|
30
|
+
const { colors } = themeContext.useVanillaExtractTheme();
|
|
31
|
+
const { style: cssStyles, vars } = cssProps.processCSSProp(css, colors);
|
|
32
|
+
const mergedStyles = {
|
|
33
|
+
...cssStyles,
|
|
34
|
+
...style,
|
|
35
|
+
...dynamic.assignInlineVars(vars)
|
|
36
|
+
};
|
|
37
|
+
if (as) {
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
Component,
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
className: `${ButtonSwitch_vanilla_css.buttonSwitchContainer} ${className || ""}`.trim(),
|
|
43
|
+
style: mergedStyles,
|
|
44
|
+
role: "group",
|
|
45
|
+
...props,
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
);
|
|
42
49
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
ToggleGroupPrimitive__namespace.Root,
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: `${ButtonSwitch_vanilla_css.buttonSwitchContainer} ${className || ""}`.trim(),
|
|
55
|
+
style: mergedStyles,
|
|
56
|
+
...props,
|
|
57
|
+
children
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
ButtonSwitchContainerVanillaImpl.displayName = "ButtonSwitchContainerVanilla";
|
|
63
|
+
const ButtonSwitchContainerVanilla = ButtonSwitchContainerVanillaImpl;
|
|
64
|
+
const ButtonSwitchItemVanillaImpl = React.forwardRef(
|
|
65
|
+
({ as, className, css, style, children, ...props }, ref) => {
|
|
66
|
+
const Component = as || "button";
|
|
67
|
+
const { colors } = themeContext.useVanillaExtractTheme();
|
|
68
|
+
const { style: cssStyles, vars } = cssProps.processCSSProp(css, colors);
|
|
69
|
+
const mergedStyles = {
|
|
70
|
+
...cssStyles,
|
|
71
|
+
...style,
|
|
72
|
+
...dynamic.assignInlineVars(vars)
|
|
73
|
+
};
|
|
74
|
+
if (as) {
|
|
75
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
76
|
+
Component,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
className: `${ButtonSwitch_vanilla_css.buttonSwitchItem} ${className || ""}`.trim(),
|
|
80
|
+
style: mergedStyles,
|
|
81
|
+
role: "radio",
|
|
82
|
+
...props,
|
|
83
|
+
children
|
|
84
|
+
}
|
|
85
|
+
);
|
|
61
86
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
87
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
ToggleGroupPrimitive__namespace.Item,
|
|
89
|
+
{
|
|
90
|
+
ref,
|
|
91
|
+
className: `${ButtonSwitch_vanilla_css.buttonSwitchItem} ${className || ""}`.trim(),
|
|
92
|
+
style: mergedStyles,
|
|
93
|
+
...props,
|
|
94
|
+
children
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
ButtonSwitchItemVanillaImpl.displayName = "ButtonSwitchItemVanilla";
|
|
100
|
+
const ButtonSwitchItemVanilla = ButtonSwitchItemVanillaImpl;
|
|
65
101
|
exports.ButtonSwitchContainerVanilla = ButtonSwitchContainerVanilla;
|
|
66
102
|
exports.ButtonSwitchItemVanilla = ButtonSwitchItemVanilla;
|
|
67
103
|
//# sourceMappingURL=ButtonSwitch.vanilla.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSwitch.vanilla.cjs","sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\
|
|
1
|
+
{"version":3,"file":"ButtonSwitch.vanilla.cjs","sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\ninterface ButtonSwitchContainerOwnProps extends CSSProps {\n type?: 'single' | 'multiple';\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n rovingFocus?: boolean;\n loop?: boolean;\n orientation?: 'horizontal' | 'vertical';\n dir?: 'ltr' | 'rtl';\n}\n\nexport type ButtonSwitchContainerVanillaProps<C extends ElementType = 'div'> =\n PolymorphicComponentProps<C, ButtonSwitchContainerOwnProps>;\n\ntype ButtonSwitchContainerVanillaComponent = PolymorphicComponent<\n 'div',\n ButtonSwitchContainerVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchContainerVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, children, ...props }: ButtonSwitchContainerVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'div') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"group\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref as any}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nButtonSwitchContainerVanillaImpl.displayName = 'ButtonSwitchContainerVanilla';\n\nexport const ButtonSwitchContainerVanilla =\n ButtonSwitchContainerVanillaImpl as ButtonSwitchContainerVanillaComponent;\n\n// Item Component\ninterface ButtonSwitchItemOwnProps extends CSSProps {\n value: string;\n disabled?: boolean;\n}\n\nexport type ButtonSwitchItemVanillaProps<C extends ElementType = 'button'> =\n PolymorphicComponentProps<C, ButtonSwitchItemOwnProps>;\n\ntype ButtonSwitchItemVanillaComponent = PolymorphicComponent<\n 'button',\n ButtonSwitchItemVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchItemVanillaImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, children, ...props }: ButtonSwitchItemVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'button') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"radio\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref as any}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nButtonSwitchItemVanillaImpl.displayName = 'ButtonSwitchItemVanilla';\n\nexport const ButtonSwitchItemVanilla =\n ButtonSwitchItemVanillaImpl as ButtonSwitchItemVanillaComponent;\n"],"names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","jsx","buttonSwitchContainer","ToggleGroupPrimitive","buttonSwitchItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,mCAAmCA,MAAAA;AAAAA,EACvC,CACE,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,MAAA,GAC1C,QACG;AACH,UAAM,YAAa,MAAM;AACzB,UAAM,EAAE,OAAA,IAAWC,oCAAA;AAEnB,UAAM,EAAE,OAAO,WAAW,SAASC,SAAAA,eAAe,KAAK,MAAM;AAE7D,UAAM,eAAe;AAAA,MACnB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAGC,QAAAA,iBAAiB,IAAI;AAAA,IAAA;AAG1B,QAAI,IAAI;AACN,aACEC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAGC,8CAAqB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,UACzD,OAAO;AAAA,UACP,MAAK;AAAA,UACJ,GAAG;AAAA,UAEH;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;AAEA,WACED,2BAAAA;AAAAA,MAACE,gCAAqB;AAAA,MAArB;AAAA,QACC;AAAA,QACA,WAAW,GAAGD,8CAAqB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,QACzD,OAAO;AAAA,QACN,GAAI;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,iCAAiC,cAAc;AAExC,MAAM,+BACX;AAgBF,MAAM,8BAA8BL,MAAAA;AAAAA,EAClC,CACE,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,MAAA,GAC1C,QACG;AACH,UAAM,YAAa,MAAM;AACzB,UAAM,EAAE,OAAA,IAAWC,oCAAA;AAEnB,UAAM,EAAE,OAAO,WAAW,SAASC,SAAAA,eAAe,KAAK,MAAM;AAE7D,UAAM,eAAe;AAAA,MACnB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAGC,QAAAA,iBAAiB,IAAI;AAAA,IAAA;AAG1B,QAAI,IAAI;AACN,aACEC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAGG,yCAAgB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,UACpD,OAAO;AAAA,UACP,MAAK;AAAA,UACJ,GAAG;AAAA,UAEH;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;AAEA,WACEH,2BAAAA;AAAAA,MAACE,gCAAqB;AAAA,MAArB;AAAA,QACC;AAAA,QACA,WAAW,GAAGC,yCAAgB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,QACpD,OAAO;AAAA,QACN,GAAI;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,4BAA4B,cAAc;AAEnC,MAAM,0BACX;;;"}
|
|
@@ -5,44 +5,80 @@ import { forwardRef } from "react";
|
|
|
5
5
|
import { processCSSProp } from "../../styles/cssProps.js";
|
|
6
6
|
import { useVanillaExtractTheme } from "../../styles/themeContext.js";
|
|
7
7
|
import { buttonSwitchContainer, buttonSwitchItem } from "./ButtonSwitch.vanilla.css.js";
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
const ButtonSwitchContainerVanillaImpl = forwardRef(
|
|
9
|
+
({ as, className, css, style, children, ...props }, ref) => {
|
|
10
|
+
const Component = as || "div";
|
|
11
|
+
const { colors } = useVanillaExtractTheme();
|
|
12
|
+
const { style: cssStyles, vars } = processCSSProp(css, colors);
|
|
13
|
+
const mergedStyles = {
|
|
14
|
+
...cssStyles,
|
|
15
|
+
...style,
|
|
16
|
+
...assignInlineVars(vars)
|
|
17
|
+
};
|
|
18
|
+
if (as) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Component,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: `${buttonSwitchContainer} ${className || ""}`.trim(),
|
|
24
|
+
style: mergedStyles,
|
|
25
|
+
role: "group",
|
|
26
|
+
...props,
|
|
27
|
+
children
|
|
28
|
+
}
|
|
29
|
+
);
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
ToggleGroupPrimitive.Root,
|
|
33
|
+
{
|
|
34
|
+
ref,
|
|
35
|
+
className: `${buttonSwitchContainer} ${className || ""}`.trim(),
|
|
36
|
+
style: mergedStyles,
|
|
37
|
+
...props,
|
|
38
|
+
children
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
ButtonSwitchContainerVanillaImpl.displayName = "ButtonSwitchContainerVanilla";
|
|
44
|
+
const ButtonSwitchContainerVanilla = ButtonSwitchContainerVanillaImpl;
|
|
45
|
+
const ButtonSwitchItemVanillaImpl = forwardRef(
|
|
46
|
+
({ as, className, css, style, children, ...props }, ref) => {
|
|
47
|
+
const Component = as || "button";
|
|
48
|
+
const { colors } = useVanillaExtractTheme();
|
|
49
|
+
const { style: cssStyles, vars } = processCSSProp(css, colors);
|
|
50
|
+
const mergedStyles = {
|
|
51
|
+
...cssStyles,
|
|
52
|
+
...style,
|
|
53
|
+
...assignInlineVars(vars)
|
|
54
|
+
};
|
|
55
|
+
if (as) {
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
Component,
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
className: `${buttonSwitchItem} ${className || ""}`.trim(),
|
|
61
|
+
style: mergedStyles,
|
|
62
|
+
role: "radio",
|
|
63
|
+
...props,
|
|
64
|
+
children
|
|
65
|
+
}
|
|
66
|
+
);
|
|
42
67
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
ToggleGroupPrimitive.Item,
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
className: `${buttonSwitchItem} ${className || ""}`.trim(),
|
|
73
|
+
style: mergedStyles,
|
|
74
|
+
...props,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
ButtonSwitchItemVanillaImpl.displayName = "ButtonSwitchItemVanilla";
|
|
81
|
+
const ButtonSwitchItemVanilla = ButtonSwitchItemVanillaImpl;
|
|
46
82
|
export {
|
|
47
83
|
ButtonSwitchContainerVanilla,
|
|
48
84
|
ButtonSwitchItemVanilla
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSwitch.vanilla.js","sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\
|
|
1
|
+
{"version":3,"file":"ButtonSwitch.vanilla.js","sources":["../../../components/ButtonSwitch/ButtonSwitch.vanilla.tsx"],"sourcesContent":["import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { buttonSwitchContainer, buttonSwitchItem } from './ButtonSwitch.vanilla.css';\n\n// Container Component\ninterface ButtonSwitchContainerOwnProps extends CSSProps {\n type?: 'single' | 'multiple';\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n rovingFocus?: boolean;\n loop?: boolean;\n orientation?: 'horizontal' | 'vertical';\n dir?: 'ltr' | 'rtl';\n}\n\nexport type ButtonSwitchContainerVanillaProps<C extends ElementType = 'div'> =\n PolymorphicComponentProps<C, ButtonSwitchContainerOwnProps>;\n\ntype ButtonSwitchContainerVanillaComponent = PolymorphicComponent<\n 'div',\n ButtonSwitchContainerVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchContainerVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, children, ...props }: ButtonSwitchContainerVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'div') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"group\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref as any}\n className={`${buttonSwitchContainer} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nButtonSwitchContainerVanillaImpl.displayName = 'ButtonSwitchContainerVanilla';\n\nexport const ButtonSwitchContainerVanilla =\n ButtonSwitchContainerVanillaImpl as ButtonSwitchContainerVanillaComponent;\n\n// Item Component\ninterface ButtonSwitchItemOwnProps extends CSSProps {\n value: string;\n disabled?: boolean;\n}\n\nexport type ButtonSwitchItemVanillaProps<C extends ElementType = 'button'> =\n PolymorphicComponentProps<C, ButtonSwitchItemOwnProps>;\n\ntype ButtonSwitchItemVanillaComponent = PolymorphicComponent<\n 'button',\n ButtonSwitchItemVanillaProps<ElementType>\n>;\n\nconst ButtonSwitchItemVanillaImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, children, ...props }: ButtonSwitchItemVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = (as || 'button') as any;\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n if (as) {\n return (\n <Component\n ref={ref}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n role=\"radio\"\n {...props}\n >\n {children}\n </Component>\n );\n }\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref as any}\n className={`${buttonSwitchItem} ${className || ''}`.trim()}\n style={mergedStyles}\n {...(props as any)}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n },\n);\n\nButtonSwitchItemVanillaImpl.displayName = 'ButtonSwitchItemVanilla';\n\nexport const ButtonSwitchItemVanilla =\n ButtonSwitchItemVanillaImpl as ButtonSwitchItemVanillaComponent;\n"],"names":[],"mappings":";;;;;;;AAkCA,MAAM,mCAAmC;AAAA,EACvC,CACE,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,MAAA,GAC1C,QACG;AACH,UAAM,YAAa,MAAM;AACzB,UAAM,EAAE,OAAA,IAAW,uBAAA;AAEnB,UAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;AAE7D,UAAM,eAAe;AAAA,MACnB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG,iBAAiB,IAAI;AAAA,IAAA;AAG1B,QAAI,IAAI;AACN,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAG,qBAAqB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,UACzD,OAAO;AAAA,UACP,MAAK;AAAA,UACJ,GAAG;AAAA,UAEH;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;AAEA,WACE;AAAA,MAAC,qBAAqB;AAAA,MAArB;AAAA,QACC;AAAA,QACA,WAAW,GAAG,qBAAqB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,QACzD,OAAO;AAAA,QACN,GAAI;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,iCAAiC,cAAc;AAExC,MAAM,+BACX;AAgBF,MAAM,8BAA8B;AAAA,EAClC,CACE,EAAE,IAAI,WAAW,KAAK,OAAO,UAAU,GAAG,MAAA,GAC1C,QACG;AACH,UAAM,YAAa,MAAM;AACzB,UAAM,EAAE,OAAA,IAAW,uBAAA;AAEnB,UAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;AAE7D,UAAM,eAAe;AAAA,MACnB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG,iBAAiB,IAAI;AAAA,IAAA;AAG1B,QAAI,IAAI;AACN,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAG,gBAAgB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,UACpD,OAAO;AAAA,UACP,MAAK;AAAA,UACJ,GAAG;AAAA,UAEH;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;AAEA,WACE;AAAA,MAAC,qBAAqB;AAAA,MAArB;AAAA,QACC;AAAA,QACA,WAAW,GAAG,gBAAgB,IAAI,aAAa,EAAE,GAAG,KAAA;AAAA,QACpD,OAAO;AAAA,QACN,GAAI;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,4BAA4B,cAAc;AAEnC,MAAM,0BACX;"}
|