@traefik-labs/faency 13.7.1 → 13.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/README.md +1 -2
- package/dist/components/AriaTable/AriaTable.cjs +48 -22
- package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.js +49 -23
- package/dist/components/AriaTable/AriaTable.js.map +1 -1
- package/dist/components/AriaTable/AriaTable.vanilla.cjs +8 -4
- package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.vanilla.js +8 -4
- package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.cjs +5 -2
- package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.vanilla.js +5 -2
- package/dist/components/Avatar/Avatar.vanilla.js.map +1 -1
- package/dist/components/Badge/Badge.vanilla.cjs +2 -10
- package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
- package/dist/components/Badge/Badge.vanilla.js +2 -10
- package/dist/components/Badge/Badge.vanilla.js.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.cjs +5 -11
- package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
- package/dist/components/Blockquote/Blockquote.vanilla.js +5 -11
- package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
- package/dist/components/Box/Box.vanilla.cjs +2 -10
- package/dist/components/Box/Box.vanilla.cjs.map +1 -1
- package/dist/components/Box/Box.vanilla.js +2 -10
- package/dist/components/Box/Box.vanilla.js.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.cjs +2 -10
- package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
- package/dist/components/Bubble/Bubble.vanilla.js +2 -10
- package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
- package/dist/components/Button/Button.vanilla.cjs +2 -10
- package/dist/components/Button/Button.vanilla.cjs.map +1 -1
- package/dist/components/Button/Button.vanilla.js +2 -10
- package/dist/components/Button/Button.vanilla.js.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +3 -17
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +3 -17
- package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
- package/dist/components/Card/Card.vanilla.cjs +6 -11
- package/dist/components/Card/Card.vanilla.cjs.map +1 -1
- package/dist/components/Card/Card.vanilla.js +6 -11
- package/dist/components/Card/Card.vanilla.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -6
- package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -6
- package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.cjs +3 -10
- package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.js +3 -10
- package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
- package/dist/components/Container/Container.vanilla.cjs +5 -11
- package/dist/components/Container/Container.vanilla.cjs.map +1 -1
- package/dist/components/Container/Container.vanilla.js +5 -11
- package/dist/components/Container/Container.vanilla.js.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.cjs +5 -11
- package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
- package/dist/components/Elevation/Elevation.vanilla.js +5 -11
- package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
- package/dist/components/Field/Field.vanilla.cjs +3 -9
- package/dist/components/Field/Field.vanilla.cjs.map +1 -1
- package/dist/components/Field/Field.vanilla.js +3 -9
- package/dist/components/Field/Field.vanilla.js.map +1 -1
- package/dist/components/Flex/Flex.vanilla.cjs +5 -11
- package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
- package/dist/components/Flex/Flex.vanilla.js +5 -11
- package/dist/components/Flex/Flex.vanilla.js.map +1 -1
- package/dist/components/Grid/Grid.vanilla.cjs +7 -11
- package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
- package/dist/components/Grid/Grid.vanilla.js +7 -11
- package/dist/components/Grid/Grid.vanilla.js.map +1 -1
- package/dist/components/Heading/Heading.vanilla.cjs +35 -0
- package/dist/components/Heading/Heading.vanilla.cjs.map +1 -0
- package/dist/components/Heading/Heading.vanilla.css.cjs +85 -0
- package/dist/components/Heading/Heading.vanilla.css.cjs.map +1 -0
- package/dist/components/Heading/Heading.vanilla.css.js +74 -0
- package/dist/components/Heading/Heading.vanilla.css.js.map +1 -0
- package/dist/components/Heading/Heading.vanilla.js +30 -0
- package/dist/components/Heading/Heading.vanilla.js.map +1 -0
- package/dist/components/IconButton/IconButton.vanilla.cjs +5 -11
- package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.vanilla.js +5 -11
- package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
- package/dist/components/Image/Image.vanilla.cjs +2 -10
- package/dist/components/Image/Image.vanilla.cjs.map +1 -1
- package/dist/components/Image/Image.vanilla.js +2 -10
- package/dist/components/Image/Image.vanilla.js.map +1 -1
- package/dist/components/Input/Input.vanilla.cjs +2 -10
- package/dist/components/Input/Input.vanilla.cjs.map +1 -1
- package/dist/components/Input/Input.vanilla.js +2 -10
- package/dist/components/Input/Input.vanilla.js.map +1 -1
- package/dist/components/Label/Label.vanilla.cjs +5 -11
- package/dist/components/Label/Label.vanilla.cjs.map +1 -1
- package/dist/components/Label/Label.vanilla.js +5 -11
- package/dist/components/Label/Label.vanilla.js.map +1 -1
- package/dist/components/List/List.vanilla.cjs +10 -18
- package/dist/components/List/List.vanilla.cjs.map +1 -1
- package/dist/components/List/List.vanilla.js +7 -15
- package/dist/components/List/List.vanilla.js.map +1 -1
- package/dist/components/Meter/Meter.vanilla.cjs +3 -8
- package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
- package/dist/components/Meter/Meter.vanilla.js +3 -8
- package/dist/components/Meter/Meter.vanilla.js.map +1 -1
- package/dist/components/Panel/Panel.vanilla.cjs +2 -10
- package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
- package/dist/components/Panel/Panel.vanilla.js +2 -10
- package/dist/components/Panel/Panel.vanilla.js.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.cjs +5 -11
- package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
- package/dist/components/Paragraph/Paragraph.vanilla.js +5 -11
- package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
- package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -1
- package/dist/components/RowLink/RowLink.vanilla.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -14
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -14
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
- package/dist/components/Select/Select.vanilla.cjs +136 -0
- package/dist/components/Select/Select.vanilla.cjs.map +1 -0
- package/dist/components/Select/Select.vanilla.css.cjs +69 -0
- package/dist/components/Select/Select.vanilla.css.cjs.map +1 -0
- package/dist/components/Select/Select.vanilla.css.js +58 -0
- package/dist/components/Select/Select.vanilla.css.js.map +1 -0
- package/dist/components/Select/Select.vanilla.js +129 -0
- package/dist/components/Select/Select.vanilla.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -10
- package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
- package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
- package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.js +3 -6
- package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
- package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
- package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
- package/dist/components/Switch/Switch.vanilla.cjs +70 -0
- package/dist/components/Switch/Switch.vanilla.cjs.map +1 -0
- package/dist/components/Switch/Switch.vanilla.css.cjs +17 -0
- package/dist/components/Switch/Switch.vanilla.css.cjs.map +1 -0
- package/dist/components/Switch/Switch.vanilla.css.js +17 -0
- package/dist/components/Switch/Switch.vanilla.css.js.map +1 -0
- package/dist/components/Switch/Switch.vanilla.js +68 -0
- package/dist/components/Switch/Switch.vanilla.js.map +1 -0
- package/dist/components/Table/Table.vanilla.cjs +8 -4
- package/dist/components/Table/Table.vanilla.cjs.map +1 -1
- package/dist/components/Table/Table.vanilla.js +8 -4
- package/dist/components/Table/Table.vanilla.js.map +1 -1
- package/dist/components/Text/Text.vanilla.cjs +5 -11
- package/dist/components/Text/Text.vanilla.cjs.map +1 -1
- package/dist/components/Text/Text.vanilla.js +5 -11
- package/dist/components/Text/Text.vanilla.js.map +1 -1
- package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
- package/dist/components/TextField/TextField.vanilla.js.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
- package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.vanilla.js +2 -10
- package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
- package/dist/components/Toast/Toast.vanilla.cjs +4 -15
- package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
- package/dist/components/Toast/Toast.vanilla.js +4 -15
- package/dist/components/Toast/Toast.vanilla.js.map +1 -1
- package/dist/faency.css +3098 -2517
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +36968 -0
- package/dist/index.d.ts +416 -94
- package/dist/index.js +5 -1
- package/dist/styles/recipeVariants.cjs +15 -0
- package/dist/styles/recipeVariants.cjs.map +1 -0
- package/dist/styles/recipeVariants.js +15 -0
- package/dist/styles/recipeVariants.js.map +1 -0
- package/dist/styles/themeContext.cjs.map +1 -1
- package/dist/styles/themeContext.js.map +1 -1
- package/dist/styles/tokens.css.cjs +146 -133
- package/dist/styles/tokens.css.js +146 -133
- package/package.json +18 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.vanilla.cjs","names":["
|
|
1
|
+
{"version":3,"file":"SegmentedControl.vanilla.cjs","names":["createContext","forwardRef","RadioGroupPrimitive","cx","segmentedControlRecipe","useInlineStyle","useContext","segmentedControlItemRecipe"],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport React, { ComponentPropsWithoutRef, createContext, forwardRef, useContext } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n segmentedControlItemRecipe,\n segmentedControlRecipe,\n SegmentedControlSize,\n} from './SegmentedControl.vanilla.css';\n\nexport type { SegmentedControlSize };\n\nconst SegmentedControlContext = createContext<{\n size: SegmentedControlSize;\n fullWidth: boolean;\n}>({ size: 'medium', fullWidth: false });\n\nexport interface SegmentedControlVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'asChild'>, CSSProps {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}\n\nexport const SegmentedControlVanilla = forwardRef<HTMLDivElement, SegmentedControlVanillaProps>(\n ({ size = 'medium', fullWidth = false, className, css, style, children, ...props }, ref) => (\n <SegmentedControlContext.Provider value={{ size, fullWidth }}>\n <RadioGroupPrimitive.Root\n ref={ref}\n orientation=\"horizontal\"\n className={cx(segmentedControlRecipe({ fullWidth }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n ),\n);\n\nSegmentedControlVanilla.displayName = 'SegmentedControlVanilla';\n\nexport interface SegmentedControlItemVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'>, CSSProps {}\n\nexport const SegmentedControlItemVanilla = forwardRef<\n HTMLButtonElement,\n SegmentedControlItemVanillaProps\n>(({ className, css, style, ...props }, ref) => {\n const { size, fullWidth } = useContext(SegmentedControlContext);\n\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cx(segmentedControlItemRecipe({ size, fullWidth }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n );\n});\n\nSegmentedControlItemVanilla.displayName = 'SegmentedControlItemVanilla';\n"],"mappings":";;;;;;;;;;AAeA,IAAM,2BAAA,GAA0BA,MAAAA,cAAAA,CAG7B;CAAE,MAAM;CAAU,WAAW;AAAM,CAAC;AAQvC,IAAa,2BAAA,GAA0BC,MAAAA,WAAAA,EACpC,EAAE,OAAO,UAAU,YAAY,OAAO,WAAW,KAAK,OAAO,UAAU,GAAG,SAAS,QAClF,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAwB,UAAzB;CAAkC,OAAO;EAAE;EAAM;CAAU;CACzD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAoB,MAArB;EACO;EACL,aAAY;EACZ,WAAWC,WAAAA,GAAGC,qCAAAA,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;EAC9D,OAAOC,uBAAAA,eAAe,KAAK,KAAK;EAChC,GAAI;EAEH;CACuB,CAAA;AACM,CAAA,CAEtC;AAEA,wBAAwB,cAAc;AAKtC,IAAa,+BAAA,GAA8BJ,MAAAA,WAAAA,EAGxC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC9C,MAAM,EAAE,MAAM,eAAA,GAAcK,MAAAA,WAAAA,CAAW,uBAAuB;CAE9D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACJ,4BAAoB,MAArB;EACO;EACL,WAAWC,WAAAA,GAAGI,qCAAAA,2BAA2B;GAAE;GAAM;EAAU,CAAC,GAAG,SAAS;EACxE,OAAOF,uBAAAA,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
1
|
import { cx } from "../../styles/cx.js";
|
|
3
|
-
import {
|
|
2
|
+
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
4
3
|
import { segmentedControlItemRecipe, segmentedControlRecipe } from "./SegmentedControl.vanilla.css.js";
|
|
5
4
|
import { createContext, forwardRef, useContext } from "react";
|
|
6
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
7
5
|
import { jsx } from "react/jsx-runtime";
|
|
8
6
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
9
7
|
// components/SegmentedControl/SegmentedControl.vanilla.tsx
|
|
10
|
-
var useCssProp = (css, style) => {
|
|
11
|
-
const { colors } = useVanillaExtractTheme();
|
|
12
|
-
const { style: cssStyles, vars } = processCSSProp(css, colors);
|
|
13
|
-
return {
|
|
14
|
-
...cssStyles,
|
|
15
|
-
...style,
|
|
16
|
-
...assignInlineVars(vars)
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
8
|
var SegmentedControlContext = createContext({
|
|
20
9
|
size: "medium",
|
|
21
10
|
fullWidth: false
|
|
@@ -29,7 +18,7 @@ var SegmentedControlVanilla = forwardRef(({ size = "medium", fullWidth = false,
|
|
|
29
18
|
ref,
|
|
30
19
|
orientation: "horizontal",
|
|
31
20
|
className: cx(segmentedControlRecipe({ fullWidth }), className),
|
|
32
|
-
style:
|
|
21
|
+
style: useInlineStyle(css, style),
|
|
33
22
|
...props,
|
|
34
23
|
children
|
|
35
24
|
})
|
|
@@ -43,7 +32,7 @@ var SegmentedControlItemVanilla = forwardRef(({ className, css, style, ...props
|
|
|
43
32
|
size,
|
|
44
33
|
fullWidth
|
|
45
34
|
}), className),
|
|
46
|
-
style:
|
|
35
|
+
style: useInlineStyle(css, style),
|
|
47
36
|
...props
|
|
48
37
|
});
|
|
49
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.vanilla.js","names":[],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport
|
|
1
|
+
{"version":3,"file":"SegmentedControl.vanilla.js","names":[],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport React, { ComponentPropsWithoutRef, createContext, forwardRef, useContext } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n segmentedControlItemRecipe,\n segmentedControlRecipe,\n SegmentedControlSize,\n} from './SegmentedControl.vanilla.css';\n\nexport type { SegmentedControlSize };\n\nconst SegmentedControlContext = createContext<{\n size: SegmentedControlSize;\n fullWidth: boolean;\n}>({ size: 'medium', fullWidth: false });\n\nexport interface SegmentedControlVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'asChild'>, CSSProps {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}\n\nexport const SegmentedControlVanilla = forwardRef<HTMLDivElement, SegmentedControlVanillaProps>(\n ({ size = 'medium', fullWidth = false, className, css, style, children, ...props }, ref) => (\n <SegmentedControlContext.Provider value={{ size, fullWidth }}>\n <RadioGroupPrimitive.Root\n ref={ref}\n orientation=\"horizontal\"\n className={cx(segmentedControlRecipe({ fullWidth }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n ),\n);\n\nSegmentedControlVanilla.displayName = 'SegmentedControlVanilla';\n\nexport interface SegmentedControlItemVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'>, CSSProps {}\n\nexport const SegmentedControlItemVanilla = forwardRef<\n HTMLButtonElement,\n SegmentedControlItemVanillaProps\n>(({ className, css, style, ...props }, ref) => {\n const { size, fullWidth } = useContext(SegmentedControlContext);\n\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cx(segmentedControlItemRecipe({ size, fullWidth }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n );\n});\n\nSegmentedControlItemVanilla.displayName = 'SegmentedControlItemVanilla';\n"],"mappings":";;;;;;;AAeA,IAAM,0BAA0B,cAG7B;CAAE,MAAM;CAAU,WAAW;AAAM,CAAC;AAQvC,IAAa,0BAA0B,YACpC,EAAE,OAAO,UAAU,YAAY,OAAO,WAAW,KAAK,OAAO,UAAU,GAAG,SAAS,QAClF,oBAAC,wBAAwB,UAAzB;CAAkC,OAAO;EAAE;EAAM;CAAU;CACzD,UAAA,oBAAC,oBAAoB,MAArB;EACO;EACL,aAAY;EACZ,WAAW,GAAG,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;EAC9D,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;EAEH;CACuB,CAAA;AACM,CAAA,CAEtC;AAEA,wBAAwB,cAAc;AAKtC,IAAa,8BAA8B,YAGxC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC9C,MAAM,EAAE,MAAM,cAAc,WAAW,uBAAuB;CAE9D,OACE,oBAAC,oBAAoB,MAArB;EACO;EACL,WAAW,GAAG,2BAA2B;GAAE;GAAM;EAAU,CAAC,GAAG,SAAS;EACxE,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_cx = require("../../styles/cx.cjs");
|
|
3
|
+
const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
|
|
4
|
+
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
5
|
+
const require_Select_vanilla_css = require("./Select.vanilla.css.cjs");
|
|
6
|
+
let _radix_ui_react_icons = require("@radix-ui/react-icons");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_runtime.__toESM(react, 1);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let _radix_ui_react_select = require("@radix-ui/react-select");
|
|
11
|
+
_radix_ui_react_select = require_runtime.__toESM(_radix_ui_react_select, 1);
|
|
12
|
+
// components/Select/Select.vanilla.tsx
|
|
13
|
+
var SelectSizeContext = react.default.createContext("medium");
|
|
14
|
+
var SelectVanilla = react.default.forwardRef(({ value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, name, form, required, autoComplete, disabled, dir, placeholder, size = "medium", variant, state, id, css, className, style, children, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
|
|
15
|
+
const contentRef = react.default.useRef(null);
|
|
16
|
+
const control = require_FieldContext.useFieldControl({
|
|
17
|
+
id,
|
|
18
|
+
disabled,
|
|
19
|
+
invalid: state === "invalid",
|
|
20
|
+
"aria-describedby": ariaDescribedBy,
|
|
21
|
+
"aria-invalid": ariaInvalid
|
|
22
|
+
});
|
|
23
|
+
const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
|
|
24
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectSizeContext.Provider, {
|
|
25
|
+
value: size,
|
|
26
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Root, {
|
|
27
|
+
value,
|
|
28
|
+
defaultValue,
|
|
29
|
+
onValueChange,
|
|
30
|
+
open,
|
|
31
|
+
defaultOpen,
|
|
32
|
+
onOpenChange,
|
|
33
|
+
name,
|
|
34
|
+
form,
|
|
35
|
+
required,
|
|
36
|
+
autoComplete,
|
|
37
|
+
disabled: control.disabled,
|
|
38
|
+
dir,
|
|
39
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Trigger, {
|
|
40
|
+
ref: forwardedRef,
|
|
41
|
+
id: control.id,
|
|
42
|
+
"aria-describedby": control["aria-describedby"],
|
|
43
|
+
"aria-invalid": control["aria-invalid"],
|
|
44
|
+
className: require_cx.cx(require_Select_vanilla_css.selectTriggerRecipe({
|
|
45
|
+
size,
|
|
46
|
+
variant,
|
|
47
|
+
state: control.invalid ? "invalid" : state
|
|
48
|
+
}), className),
|
|
49
|
+
style: inlineStyle,
|
|
50
|
+
onBlur: (event) => {
|
|
51
|
+
if (!contentRef.current?.contains(event.relatedTarget)) onBlur?.(event);
|
|
52
|
+
},
|
|
53
|
+
...props,
|
|
54
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
55
|
+
className: require_Select_vanilla_css.selectValue,
|
|
56
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, { placeholder })
|
|
57
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Icon, {
|
|
58
|
+
className: require_Select_vanilla_css.selectIcon,
|
|
59
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.CaretSortIcon, {})
|
|
60
|
+
})]
|
|
61
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Content, {
|
|
62
|
+
ref: contentRef,
|
|
63
|
+
className: require_Select_vanilla_css.selectContent,
|
|
64
|
+
position: "popper",
|
|
65
|
+
sideOffset: 4,
|
|
66
|
+
collisionPadding: 8,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ScrollUpButton, {
|
|
69
|
+
className: require_Select_vanilla_css.selectScrollButton,
|
|
70
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.ChevronUpIcon, {})
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Viewport, {
|
|
73
|
+
className: require_Select_vanilla_css.selectViewport,
|
|
74
|
+
children
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ScrollDownButton, {
|
|
77
|
+
className: require_Select_vanilla_css.selectScrollButton,
|
|
78
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.ChevronDownIcon, {})
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}) })]
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
SelectVanilla.displayName = "SelectVanilla";
|
|
86
|
+
var SelectItemVanilla = react.default.forwardRef(({ description, children, css, className, style, ...props }, forwardedRef) => {
|
|
87
|
+
const size = react.default.useContext(SelectSizeContext);
|
|
88
|
+
const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
|
|
89
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
90
|
+
ref: forwardedRef,
|
|
91
|
+
className: require_cx.cx(require_Select_vanilla_css.selectItemRecipe({ size }), className),
|
|
92
|
+
style: inlineStyle,
|
|
93
|
+
...props,
|
|
94
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
95
|
+
className: require_Select_vanilla_css.selectItemContent,
|
|
96
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children }), description != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
97
|
+
className: require_Select_vanilla_css.selectItemDescriptionRecipe({ size }),
|
|
98
|
+
children: description
|
|
99
|
+
})]
|
|
100
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
101
|
+
className: require_Select_vanilla_css.selectItemIndicator,
|
|
102
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.CheckIcon, {}) })
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
SelectItemVanilla.displayName = "SelectItemVanilla";
|
|
107
|
+
var SelectGroupVanilla = react.default.forwardRef(({ css, style, ...props }, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Group, {
|
|
108
|
+
ref: forwardedRef,
|
|
109
|
+
style: require_useInlineStyle.useInlineStyle(css, style),
|
|
110
|
+
...props
|
|
111
|
+
}));
|
|
112
|
+
SelectGroupVanilla.displayName = "SelectGroupVanilla";
|
|
113
|
+
var SelectLabelVanilla = react.default.forwardRef(({ css, className, style, ...props }, forwardedRef) => {
|
|
114
|
+
const size = react.default.useContext(SelectSizeContext);
|
|
115
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Label, {
|
|
116
|
+
ref: forwardedRef,
|
|
117
|
+
className: require_cx.cx(require_Select_vanilla_css.selectLabelRecipe({ size }), className),
|
|
118
|
+
style: require_useInlineStyle.useInlineStyle(css, style),
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
SelectLabelVanilla.displayName = "SelectLabelVanilla";
|
|
123
|
+
var SelectSeparatorVanilla = react.default.forwardRef(({ css, className, style, ...props }, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Separator, {
|
|
124
|
+
ref: forwardedRef,
|
|
125
|
+
className: require_cx.cx(require_Select_vanilla_css.selectSeparator, className),
|
|
126
|
+
style: require_useInlineStyle.useInlineStyle(css, style),
|
|
127
|
+
...props
|
|
128
|
+
}));
|
|
129
|
+
SelectSeparatorVanilla.displayName = "SelectSeparatorVanilla";
|
|
130
|
+
exports.SelectGroupVanilla = SelectGroupVanilla;
|
|
131
|
+
exports.SelectItemVanilla = SelectItemVanilla;
|
|
132
|
+
exports.SelectLabelVanilla = SelectLabelVanilla;
|
|
133
|
+
exports.SelectSeparatorVanilla = SelectSeparatorVanilla;
|
|
134
|
+
exports.SelectVanilla = SelectVanilla;
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=Select.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.vanilla.cjs","names":["React","useFieldControl","useInlineStyle","SelectPrimitive","cx","selectTriggerRecipe","selectValue","selectIcon","CaretSortIcon","selectContent","selectScrollButton","ChevronUpIcon","selectViewport","ChevronDownIcon","selectItemRecipe","selectItemContent","selectItemDescriptionRecipe","selectItemIndicator","CheckIcon","selectLabelRecipe","selectSeparator"],"sources":["../../../components/Select/Select.vanilla.tsx"],"sourcesContent":["import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport React from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { useFieldControl } from '@/components/Field/FieldContext';\n\nimport {\n selectContent,\n selectIcon,\n selectItemContent,\n selectItemDescriptionRecipe,\n selectItemIndicator,\n selectItemRecipe,\n selectLabelRecipe,\n selectScrollButton,\n selectSeparator,\n selectTriggerRecipe,\n selectValue,\n selectViewport,\n} from './Select.vanilla.css';\n\ntype SelectTriggerVariants = RecipeVariantProps<typeof selectTriggerRecipe>;\ntype SelectSize = NonNullable<SelectTriggerVariants['size']>;\n\nconst SelectSizeContext = React.createContext<SelectSize>('medium');\n\ntype SelectRootProps = Omit<\n SelectPrimitive.SelectProps,\n 'children' | 'autoComplete' | 'onValueChange'\n>;\n\nexport type SelectVanillaProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof SelectRootProps | 'children' | 'type' | 'onChange'\n> &\n SelectRootProps &\n CSSProps & {\n onValueChange?: (value: string) => void;\n placeholder?: React.ReactNode;\n autoComplete?: string;\n size?: SelectTriggerVariants['size'];\n variant?: SelectTriggerVariants['variant'];\n state?: SelectTriggerVariants['state'];\n children?: React.ReactNode;\n };\n\nexport const SelectVanilla = React.forwardRef<HTMLButtonElement, SelectVanillaProps>(\n (\n {\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n name,\n form,\n required,\n autoComplete,\n disabled,\n dir,\n placeholder,\n size = 'medium',\n variant,\n state,\n id,\n css,\n className,\n style,\n children,\n onBlur,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const contentRef = React.useRef<HTMLDivElement>(null);\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectPrimitive.Root\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n name={name}\n form={form}\n required={required}\n autoComplete={autoComplete}\n disabled={control.disabled}\n dir={dir}\n >\n <SelectPrimitive.Trigger\n ref={forwardedRef}\n id={control.id}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n className={cx(\n selectTriggerRecipe({\n size,\n variant,\n state: control.invalid ? 'invalid' : state,\n }),\n className,\n )}\n style={inlineStyle}\n onBlur={(event) => {\n // Focus moving into the open list is not leaving the field.\n if (!contentRef.current?.contains(event.relatedTarget)) onBlur?.(event);\n }}\n {...props}\n >\n {/* Radix drops the className of Value. */}\n <span className={selectValue}>\n <SelectPrimitive.Value placeholder={placeholder} />\n </span>\n <SelectPrimitive.Icon className={selectIcon}>\n <CaretSortIcon />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={contentRef}\n className={selectContent}\n position=\"popper\"\n sideOffset={4}\n collisionPadding={8}\n >\n <SelectPrimitive.ScrollUpButton className={selectScrollButton}>\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n <SelectPrimitive.Viewport className={selectViewport}>\n {children}\n </SelectPrimitive.Viewport>\n <SelectPrimitive.ScrollDownButton className={selectScrollButton}>\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n </SelectSizeContext.Provider>\n );\n },\n);\n\nSelectVanilla.displayName = 'SelectVanilla';\n\nexport type SelectItemVanillaProps = Omit<SelectPrimitive.SelectItemProps, 'asChild'> &\n CSSProps & {\n /** A second line under the item, shown in the list only. */\n description?: React.ReactNode;\n };\n\nexport const SelectItemVanilla = React.forwardRef<HTMLDivElement, SelectItemVanillaProps>(\n ({ description, children, css, className, style, ...props }, forwardedRef) => {\n const size = React.useContext(SelectSizeContext);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <SelectPrimitive.Item\n ref={forwardedRef}\n className={cx(selectItemRecipe({ size }), className)}\n style={inlineStyle}\n {...props}\n >\n <span className={selectItemContent}>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n {description != null && (\n <span className={selectItemDescriptionRecipe({ size })}>{description}</span>\n )}\n </span>\n <span className={selectItemIndicator}>\n <SelectPrimitive.ItemIndicator>\n <CheckIcon />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n },\n);\n\nSelectItemVanilla.displayName = 'SelectItemVanilla';\n\nexport type SelectGroupVanillaProps = Omit<SelectPrimitive.SelectGroupProps, 'asChild'> & CSSProps;\n\nexport const SelectGroupVanilla = React.forwardRef<HTMLDivElement, SelectGroupVanillaProps>(\n ({ css, style, ...props }, forwardedRef) => (\n <SelectPrimitive.Group ref={forwardedRef} style={useInlineStyle(css, style)} {...props} />\n ),\n);\n\nSelectGroupVanilla.displayName = 'SelectGroupVanilla';\n\nexport type SelectLabelVanillaProps = Omit<SelectPrimitive.SelectLabelProps, 'asChild'> & CSSProps;\n\nexport const SelectLabelVanilla = React.forwardRef<HTMLDivElement, SelectLabelVanillaProps>(\n ({ css, className, style, ...props }, forwardedRef) => {\n const size = React.useContext(SelectSizeContext);\n\n return (\n <SelectPrimitive.Label\n ref={forwardedRef}\n className={cx(selectLabelRecipe({ size }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n );\n },\n);\n\nSelectLabelVanilla.displayName = 'SelectLabelVanilla';\n\nexport type SelectSeparatorVanillaProps = Omit<SelectPrimitive.SelectSeparatorProps, 'asChild'> &\n CSSProps;\n\nexport const SelectSeparatorVanilla = React.forwardRef<HTMLDivElement, SelectSeparatorVanillaProps>(\n ({ css, className, style, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator\n ref={forwardedRef}\n className={cx(selectSeparator, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nSelectSeparatorVanilla.displayName = 'SelectSeparatorVanilla';\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAM,oBAAoBA,MAAAA,QAAM,cAA0B,QAAQ;AAsBlE,IAAa,gBAAgBA,MAAAA,QAAM,YAE/B,EACE,OACA,cACA,eACA,MACA,aACA,cACA,MACA,MACA,UACA,cACA,UACA,KACA,aACA,OAAO,UACP,SACA,OACA,IACA,KACA,WACA,OACA,UACA,QACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,aAAaA,MAAAA,QA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recipes/createRuntimeFn");
|
|
3
|
+
// components/Select/Select.vanilla.css.ts
|
|
4
|
+
var selectTriggerRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
5
|
+
defaultClassName: "_12b0twh0",
|
|
6
|
+
variantClassNames: {
|
|
7
|
+
size: {
|
|
8
|
+
small: "_12b0twh1",
|
|
9
|
+
medium: "_12b0twh2",
|
|
10
|
+
large: "_12b0twh3"
|
|
11
|
+
},
|
|
12
|
+
variant: { ghost: "_12b0twh4" },
|
|
13
|
+
state: { invalid: "_12b0twh5" }
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: { size: "medium" },
|
|
16
|
+
compoundVariants: []
|
|
17
|
+
});
|
|
18
|
+
var selectValue = "_12b0twh6";
|
|
19
|
+
var selectIcon = "_12b0twh7";
|
|
20
|
+
var selectContent = "_12b0twh8";
|
|
21
|
+
var selectViewport = "_12b0twh9";
|
|
22
|
+
var selectScrollButton = "_12b0twha";
|
|
23
|
+
var selectItemRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
24
|
+
defaultClassName: "_12b0twhb",
|
|
25
|
+
variantClassNames: { size: {
|
|
26
|
+
small: "_12b0twhc",
|
|
27
|
+
medium: "_12b0twhd",
|
|
28
|
+
large: "_12b0twhe"
|
|
29
|
+
} },
|
|
30
|
+
defaultVariants: { size: "medium" },
|
|
31
|
+
compoundVariants: []
|
|
32
|
+
});
|
|
33
|
+
var selectItemContent = "_12b0twhf";
|
|
34
|
+
var selectItemDescriptionRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
35
|
+
defaultClassName: "_12b0twhg",
|
|
36
|
+
variantClassNames: { size: {
|
|
37
|
+
small: "_12b0twhh",
|
|
38
|
+
medium: "_12b0twhi",
|
|
39
|
+
large: "_12b0twhj"
|
|
40
|
+
} },
|
|
41
|
+
defaultVariants: { size: "medium" },
|
|
42
|
+
compoundVariants: []
|
|
43
|
+
});
|
|
44
|
+
var selectItemIndicator = "_12b0twhk";
|
|
45
|
+
var selectLabelRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
46
|
+
defaultClassName: "_12b0twhl",
|
|
47
|
+
variantClassNames: { size: {
|
|
48
|
+
small: "_12b0twhm",
|
|
49
|
+
medium: "_12b0twhn",
|
|
50
|
+
large: "_12b0twho"
|
|
51
|
+
} },
|
|
52
|
+
defaultVariants: { size: "medium" },
|
|
53
|
+
compoundVariants: []
|
|
54
|
+
});
|
|
55
|
+
var selectSeparator = "_12b0twhp";
|
|
56
|
+
exports.selectContent = selectContent;
|
|
57
|
+
exports.selectIcon = selectIcon;
|
|
58
|
+
exports.selectItemContent = selectItemContent;
|
|
59
|
+
exports.selectItemDescriptionRecipe = selectItemDescriptionRecipe;
|
|
60
|
+
exports.selectItemIndicator = selectItemIndicator;
|
|
61
|
+
exports.selectItemRecipe = selectItemRecipe;
|
|
62
|
+
exports.selectLabelRecipe = selectLabelRecipe;
|
|
63
|
+
exports.selectScrollButton = selectScrollButton;
|
|
64
|
+
exports.selectSeparator = selectSeparator;
|
|
65
|
+
exports.selectTriggerRecipe = selectTriggerRecipe;
|
|
66
|
+
exports.selectValue = selectValue;
|
|
67
|
+
exports.selectViewport = selectViewport;
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=Select.vanilla.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// components/Select/Select.vanilla.css.ts
|
|
4
|
+
var selectTriggerRecipe = createRuntimeFn({
|
|
5
|
+
defaultClassName: "_12b0twh0",
|
|
6
|
+
variantClassNames: {
|
|
7
|
+
size: {
|
|
8
|
+
small: "_12b0twh1",
|
|
9
|
+
medium: "_12b0twh2",
|
|
10
|
+
large: "_12b0twh3"
|
|
11
|
+
},
|
|
12
|
+
variant: { ghost: "_12b0twh4" },
|
|
13
|
+
state: { invalid: "_12b0twh5" }
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: { size: "medium" },
|
|
16
|
+
compoundVariants: []
|
|
17
|
+
});
|
|
18
|
+
var selectValue = "_12b0twh6";
|
|
19
|
+
var selectIcon = "_12b0twh7";
|
|
20
|
+
var selectContent = "_12b0twh8";
|
|
21
|
+
var selectViewport = "_12b0twh9";
|
|
22
|
+
var selectScrollButton = "_12b0twha";
|
|
23
|
+
var selectItemRecipe = createRuntimeFn({
|
|
24
|
+
defaultClassName: "_12b0twhb",
|
|
25
|
+
variantClassNames: { size: {
|
|
26
|
+
small: "_12b0twhc",
|
|
27
|
+
medium: "_12b0twhd",
|
|
28
|
+
large: "_12b0twhe"
|
|
29
|
+
} },
|
|
30
|
+
defaultVariants: { size: "medium" },
|
|
31
|
+
compoundVariants: []
|
|
32
|
+
});
|
|
33
|
+
var selectItemContent = "_12b0twhf";
|
|
34
|
+
var selectItemDescriptionRecipe = createRuntimeFn({
|
|
35
|
+
defaultClassName: "_12b0twhg",
|
|
36
|
+
variantClassNames: { size: {
|
|
37
|
+
small: "_12b0twhh",
|
|
38
|
+
medium: "_12b0twhi",
|
|
39
|
+
large: "_12b0twhj"
|
|
40
|
+
} },
|
|
41
|
+
defaultVariants: { size: "medium" },
|
|
42
|
+
compoundVariants: []
|
|
43
|
+
});
|
|
44
|
+
var selectItemIndicator = "_12b0twhk";
|
|
45
|
+
var selectLabelRecipe = createRuntimeFn({
|
|
46
|
+
defaultClassName: "_12b0twhl",
|
|
47
|
+
variantClassNames: { size: {
|
|
48
|
+
small: "_12b0twhm",
|
|
49
|
+
medium: "_12b0twhn",
|
|
50
|
+
large: "_12b0twho"
|
|
51
|
+
} },
|
|
52
|
+
defaultVariants: { size: "medium" },
|
|
53
|
+
compoundVariants: []
|
|
54
|
+
});
|
|
55
|
+
var selectSeparator = "_12b0twhp";
|
|
56
|
+
export { selectContent, selectIcon, selectItemContent, selectItemDescriptionRecipe, selectItemIndicator, selectItemRecipe, selectLabelRecipe, selectScrollButton, selectSeparator, selectTriggerRecipe, selectValue, selectViewport };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=Select.vanilla.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.vanilla.css.js","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { cx } from "../../styles/cx.js";
|
|
2
|
+
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
3
|
+
import { useFieldControl } from "../Field/FieldContext.js";
|
|
4
|
+
import { selectContent, selectIcon, selectItemContent, selectItemDescriptionRecipe, selectItemIndicator, selectItemRecipe, selectLabelRecipe, selectScrollButton, selectSeparator, selectTriggerRecipe, selectValue, selectViewport } from "./Select.vanilla.css.js";
|
|
5
|
+
import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@radix-ui/react-icons";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
9
|
+
// components/Select/Select.vanilla.tsx
|
|
10
|
+
var SelectSizeContext = React.createContext("medium");
|
|
11
|
+
var SelectVanilla = React.forwardRef(({ value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, name, form, required, autoComplete, disabled, dir, placeholder, size = "medium", variant, state, id, css, className, style, children, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
|
|
12
|
+
const contentRef = React.useRef(null);
|
|
13
|
+
const control = useFieldControl({
|
|
14
|
+
id,
|
|
15
|
+
disabled,
|
|
16
|
+
invalid: state === "invalid",
|
|
17
|
+
"aria-describedby": ariaDescribedBy,
|
|
18
|
+
"aria-invalid": ariaInvalid
|
|
19
|
+
});
|
|
20
|
+
const inlineStyle = useInlineStyle(css, style);
|
|
21
|
+
return /* @__PURE__ */ jsx(SelectSizeContext.Provider, {
|
|
22
|
+
value: size,
|
|
23
|
+
children: /* @__PURE__ */ jsxs(SelectPrimitive.Root, {
|
|
24
|
+
value,
|
|
25
|
+
defaultValue,
|
|
26
|
+
onValueChange,
|
|
27
|
+
open,
|
|
28
|
+
defaultOpen,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
name,
|
|
31
|
+
form,
|
|
32
|
+
required,
|
|
33
|
+
autoComplete,
|
|
34
|
+
disabled: control.disabled,
|
|
35
|
+
dir,
|
|
36
|
+
children: [/* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
37
|
+
ref: forwardedRef,
|
|
38
|
+
id: control.id,
|
|
39
|
+
"aria-describedby": control["aria-describedby"],
|
|
40
|
+
"aria-invalid": control["aria-invalid"],
|
|
41
|
+
className: cx(selectTriggerRecipe({
|
|
42
|
+
size,
|
|
43
|
+
variant,
|
|
44
|
+
state: control.invalid ? "invalid" : state
|
|
45
|
+
}), className),
|
|
46
|
+
style: inlineStyle,
|
|
47
|
+
onBlur: (event) => {
|
|
48
|
+
if (!contentRef.current?.contains(event.relatedTarget)) onBlur?.(event);
|
|
49
|
+
},
|
|
50
|
+
...props,
|
|
51
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: selectValue,
|
|
53
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.Value, { placeholder })
|
|
54
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
55
|
+
className: selectIcon,
|
|
56
|
+
children: /* @__PURE__ */ jsx(CaretSortIcon, {})
|
|
57
|
+
})]
|
|
58
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
59
|
+
ref: contentRef,
|
|
60
|
+
className: selectContent,
|
|
61
|
+
position: "popper",
|
|
62
|
+
sideOffset: 4,
|
|
63
|
+
collisionPadding: 8,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
66
|
+
className: selectScrollButton,
|
|
67
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
70
|
+
className: selectViewport,
|
|
71
|
+
children
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
74
|
+
className: selectScrollButton,
|
|
75
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}) })]
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
SelectVanilla.displayName = "SelectVanilla";
|
|
83
|
+
var SelectItemVanilla = React.forwardRef(({ description, children, css, className, style, ...props }, forwardedRef) => {
|
|
84
|
+
const size = React.useContext(SelectSizeContext);
|
|
85
|
+
const inlineStyle = useInlineStyle(css, style);
|
|
86
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
87
|
+
ref: forwardedRef,
|
|
88
|
+
className: cx(selectItemRecipe({ size }), className),
|
|
89
|
+
style: inlineStyle,
|
|
90
|
+
...props,
|
|
91
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
92
|
+
className: selectItemContent,
|
|
93
|
+
children: [/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }), description != null && /* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: selectItemDescriptionRecipe({ size }),
|
|
95
|
+
children: description
|
|
96
|
+
})]
|
|
97
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: selectItemIndicator,
|
|
99
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
SelectItemVanilla.displayName = "SelectItemVanilla";
|
|
104
|
+
var SelectGroupVanilla = React.forwardRef(({ css, style, ...props }, forwardedRef) => /* @__PURE__ */ jsx(SelectPrimitive.Group, {
|
|
105
|
+
ref: forwardedRef,
|
|
106
|
+
style: useInlineStyle(css, style),
|
|
107
|
+
...props
|
|
108
|
+
}));
|
|
109
|
+
SelectGroupVanilla.displayName = "SelectGroupVanilla";
|
|
110
|
+
var SelectLabelVanilla = React.forwardRef(({ css, className, style, ...props }, forwardedRef) => {
|
|
111
|
+
const size = React.useContext(SelectSizeContext);
|
|
112
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
113
|
+
ref: forwardedRef,
|
|
114
|
+
className: cx(selectLabelRecipe({ size }), className),
|
|
115
|
+
style: useInlineStyle(css, style),
|
|
116
|
+
...props
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
SelectLabelVanilla.displayName = "SelectLabelVanilla";
|
|
120
|
+
var SelectSeparatorVanilla = React.forwardRef(({ css, className, style, ...props }, forwardedRef) => /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
121
|
+
ref: forwardedRef,
|
|
122
|
+
className: cx(selectSeparator, className),
|
|
123
|
+
style: useInlineStyle(css, style),
|
|
124
|
+
...props
|
|
125
|
+
}));
|
|
126
|
+
SelectSeparatorVanilla.displayName = "SelectSeparatorVanilla";
|
|
127
|
+
export { SelectGroupVanilla, SelectItemVanilla, SelectLabelVanilla, SelectSeparatorVanilla, SelectVanilla };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=Select.vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.vanilla.js","names":[],"sources":["../../../components/Select/Select.vanilla.tsx"],"sourcesContent":["import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport React from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { useFieldControl } from '@/components/Field/FieldContext';\n\nimport {\n selectContent,\n selectIcon,\n selectItemContent,\n selectItemDescriptionRecipe,\n selectItemIndicator,\n selectItemRecipe,\n selectLabelRecipe,\n selectScrollButton,\n selectSeparator,\n selectTriggerRecipe,\n selectValue,\n selectViewport,\n} from './Select.vanilla.css';\n\ntype SelectTriggerVariants = RecipeVariantProps<typeof selectTriggerRecipe>;\ntype SelectSize = NonNullable<SelectTriggerVariants['size']>;\n\nconst SelectSizeContext = React.createContext<SelectSize>('medium');\n\ntype SelectRootProps = Omit<\n SelectPrimitive.SelectProps,\n 'children' | 'autoComplete' | 'onValueChange'\n>;\n\nexport type SelectVanillaProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof SelectRootProps | 'children' | 'type' | 'onChange'\n> &\n SelectRootProps &\n CSSProps & {\n onValueChange?: (value: string) => void;\n placeholder?: React.ReactNode;\n autoComplete?: string;\n size?: SelectTriggerVariants['size'];\n variant?: SelectTriggerVariants['variant'];\n state?: SelectTriggerVariants['state'];\n children?: React.ReactNode;\n };\n\nexport const SelectVanilla = React.forwardRef<HTMLButtonElement, SelectVanillaProps>(\n (\n {\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n name,\n form,\n required,\n autoComplete,\n disabled,\n dir,\n placeholder,\n size = 'medium',\n variant,\n state,\n id,\n css,\n className,\n style,\n children,\n onBlur,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const contentRef = React.useRef<HTMLDivElement>(null);\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectPrimitive.Root\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n name={name}\n form={form}\n required={required}\n autoComplete={autoComplete}\n disabled={control.disabled}\n dir={dir}\n >\n <SelectPrimitive.Trigger\n ref={forwardedRef}\n id={control.id}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n className={cx(\n selectTriggerRecipe({\n size,\n variant,\n state: control.invalid ? 'invalid' : state,\n }),\n className,\n )}\n style={inlineStyle}\n onBlur={(event) => {\n // Focus moving into the open list is not leaving the field.\n if (!contentRef.current?.contains(event.relatedTarget)) onBlur?.(event);\n }}\n {...props}\n >\n {/* Radix drops the className of Value. */}\n <span className={selectValue}>\n <SelectPrimitive.Value placeholder={placeholder} />\n </span>\n <SelectPrimitive.Icon className={selectIcon}>\n <CaretSortIcon />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={contentRef}\n className={selectContent}\n position=\"popper\"\n sideOffset={4}\n collisionPadding={8}\n >\n <SelectPrimitive.ScrollUpButton className={selectScrollButton}>\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n <SelectPrimitive.Viewport className={selectViewport}>\n {children}\n </SelectPrimitive.Viewport>\n <SelectPrimitive.ScrollDownButton className={selectScrollButton}>\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n </SelectSizeContext.Provider>\n );\n },\n);\n\nSelectVanilla.displayName = 'SelectVanilla';\n\nexport type SelectItemVanillaProps = Omit<SelectPrimitive.SelectItemProps, 'asChild'> &\n CSSProps & {\n /** A second line under the item, shown in the list only. */\n description?: React.ReactNode;\n };\n\nexport const SelectItemVanilla = React.forwardRef<HTMLDivElement, SelectItemVanillaProps>(\n ({ description, children, css, className, style, ...props }, forwardedRef) => {\n const size = React.useContext(SelectSizeContext);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <SelectPrimitive.Item\n ref={forwardedRef}\n className={cx(selectItemRecipe({ size }), className)}\n style={inlineStyle}\n {...props}\n >\n <span className={selectItemContent}>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n {description != null && (\n <span className={selectItemDescriptionRecipe({ size })}>{description}</span>\n )}\n </span>\n <span className={selectItemIndicator}>\n <SelectPrimitive.ItemIndicator>\n <CheckIcon />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n },\n);\n\nSelectItemVanilla.displayName = 'SelectItemVanilla';\n\nexport type SelectGroupVanillaProps = Omit<SelectPrimitive.SelectGroupProps, 'asChild'> & CSSProps;\n\nexport const SelectGroupVanilla = React.forwardRef<HTMLDivElement, SelectGroupVanillaProps>(\n ({ css, style, ...props }, forwardedRef) => (\n <SelectPrimitive.Group ref={forwardedRef} style={useInlineStyle(css, style)} {...props} />\n ),\n);\n\nSelectGroupVanilla.displayName = 'SelectGroupVanilla';\n\nexport type SelectLabelVanillaProps = Omit<SelectPrimitive.SelectLabelProps, 'asChild'> & CSSProps;\n\nexport const SelectLabelVanilla = React.forwardRef<HTMLDivElement, SelectLabelVanillaProps>(\n ({ css, className, style, ...props }, forwardedRef) => {\n const size = React.useContext(SelectSizeContext);\n\n return (\n <SelectPrimitive.Label\n ref={forwardedRef}\n className={cx(selectLabelRecipe({ size }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n );\n },\n);\n\nSelectLabelVanilla.displayName = 'SelectLabelVanilla';\n\nexport type SelectSeparatorVanillaProps = Omit<SelectPrimitive.SelectSeparatorProps, 'asChild'> &\n CSSProps;\n\nexport const SelectSeparatorVanilla = React.forwardRef<HTMLDivElement, SelectSeparatorVanillaProps>(\n ({ css, className, style, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator\n ref={forwardedRef}\n className={cx(selectSeparator, className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n ),\n);\n\nSelectSeparatorVanilla.displayName = 'SelectSeparatorVanilla';\n"],"mappings":";;;;;;;;;AA6BA,IAAM,oBAAoB,MAAM,cAA0B,QAAQ;AAsBlE,IAAa,gBAAgB,MAAM,YAE/B,EACE,OACA,cACA,eACA,MACA,aACA,cACA,MACA,MACA,UACA,cACA,UACA,KACA,aACA,OAAO,UACP,SACA,OACA,IACA,KACA,WACA,OACA,UACA,QACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,aAAa,MAAM,OAAuB,IAAI;CACpD,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,cAAc,eAAe,KAAK,KAAK;CAE7C,OACE,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;EACjC,UAAA,qBAAC,gBAAgB,MAAjB;GACS;GACO;GACC;GACT;GACO;GACC;GACR;GACA;GACI;GACI;GACd,UAAU,QAAQ;GACb;GAZP,UAAA,CAcE,qBAAC,gBAAgB,SAAjB;IACE,KAAK;IACL,IAAI,QAAQ;IACZ,oBAAkB,QAAQ;IAC1B,gBAAc,QAAQ;IACtB,WAAW,GACT,oBAAoB;KAClB;KACA;KACA,OAAO,QAAQ,UAAU,YAAY;IACvC,CAAC,GACD,SACF;IACA,OAAO;IACP,SAAS,UAAU;KAEjB,IAAI,CAAC,WAAW,SAAS,SAAS,MAAM,aAAa,GAAG,SAAS,KAAK;IACxE;IACA,GAAI;IAlBN,UAAA,CAqBE,oBAAC,QAAD;KAAM,WAAW;KACf,UAAA,oBAAC,gBAAgB,OAAjB,EAAoC,YAAc,CAAA;IAC9C,CAAA,GACN,oBAAC,gBAAgB,MAAjB;KAAsB,WAAW;KAC/B,UAAA,oBAAC,eAAD,CAAgB,CAAA;IACI,CAAA,CACC;GACzB,CAAA,GAAA,oBAAC,gBAAgB,QAAjB,EAAA,UACE,qBAA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AI;AAAQ,CAAA,CAE7F;AAEA,mBAAmB,cAAc;AAIjC,IAAa,qBAAqB,MAAM,YACrC,EAAE,KAAK,WAAW,OAAO,GAAG,SAAS,iBAAiB;CACrD,MAAM,OAAO,MAAM,WAAW,iBAAiB;CAE/C,OACE,oBAAC,gBAAgB,OAAjB;EACE,KAAK;EACL,WAAW,GAAG,kBAAkB,EAAE,KAAK,CAAC,GAAG,SAAS;EACpD,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,mBAAmB,cAAc;AAKjC,IAAa,yBAAyB,MAAM,YACzC,EAAE,KAAK,WAAW,OAAO,GAAG,SAAS,iBACpC,oBAAC,gBAAgB,WAAjB;CACE,KAAK;CACL,WAAW,GAAG,iBAAiB,SAAS;CACxC,OAAO,eAAe,KAAK,KAAK;CAChC,GAAI;AACL,CAAA,CAEL;AAEA,uBAAuB,cAAc"}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
const require_cssProps = require("../../styles/cssProps.cjs");
|
|
2
1
|
const require_cx = require("../../styles/cx.cjs");
|
|
3
|
-
const
|
|
2
|
+
const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
|
|
4
3
|
const require_Skeleton_vanilla_css = require("./Skeleton.vanilla.css.cjs");
|
|
5
4
|
let react = require("react");
|
|
6
|
-
let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
|
|
7
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
6
|
// components/Skeleton/Skeleton.vanilla.tsx
|
|
9
7
|
var SkeletonVanillaImpl = (0, react.forwardRef)(({ as, className, css, style, variant, ...props }, ref) => {
|
|
10
8
|
const Component = as || "div";
|
|
11
|
-
const
|
|
12
|
-
const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
|
|
13
|
-
const mergedStyles = {
|
|
14
|
-
...cssStyles,
|
|
15
|
-
...style,
|
|
16
|
-
...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
|
|
17
|
-
};
|
|
9
|
+
const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
|
|
18
10
|
const recipeClass = require_Skeleton_vanilla_css.skeletonRecipe({ variant });
|
|
19
11
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
20
12
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.vanilla.cjs","names":["forwardRef","
|
|
1
|
+
{"version":3,"file":"Skeleton.vanilla.cjs","names":["forwardRef","useInlineStyle","skeletonRecipe","cx"],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { skeletonRecipe } from './Skeleton.vanilla.css';\n\ntype SkeletonRecipeVariants = RecipeVariantProps<typeof skeletonRecipe>;\n\ninterface SkeletonVanillaOwnProps extends SkeletonRecipeVariants, CSSProps {}\n\nexport type SkeletonVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SkeletonVanillaOwnProps\n>;\n\ntype SkeletonVanillaComponent = PolymorphicComponent<'div', SkeletonVanillaProps<ElementType>>;\n\nconst SkeletonVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: SkeletonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = skeletonRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nSkeletonVanillaImpl.displayName = 'SkeletonVanilla';\n\nexport const SkeletonVanilla = SkeletonVanillaImpl as SkeletonVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,uBAAA,GAAsBA,MAAAA,WAAAA,EAExB,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAcC,6BAAAA,eAAe,EAAE,QAAQ,CAAC;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,oBAAoB,cAAc;AAElC,IAAa,kBAAkB"}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
1
|
import { cx } from "../../styles/cx.js";
|
|
3
|
-
import {
|
|
2
|
+
import { useInlineStyle } from "../../styles/useInlineStyle.js";
|
|
4
3
|
import { skeletonRecipe } from "./Skeleton.vanilla.css.js";
|
|
5
4
|
import { forwardRef } from "react";
|
|
6
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
7
5
|
import { jsx } from "react/jsx-runtime";
|
|
8
6
|
// components/Skeleton/Skeleton.vanilla.tsx
|
|
9
7
|
var SkeletonVanillaImpl = forwardRef(({ as, className, css, style, variant, ...props }, ref) => {
|
|
10
8
|
const Component = as || "div";
|
|
11
|
-
const
|
|
12
|
-
const { style: cssStyles, vars } = processCSSProp(css, colors);
|
|
13
|
-
const mergedStyles = {
|
|
14
|
-
...cssStyles,
|
|
15
|
-
...style,
|
|
16
|
-
...assignInlineVars(vars)
|
|
17
|
-
};
|
|
9
|
+
const mergedStyles = useInlineStyle(css, style);
|
|
18
10
|
const recipeClass = skeletonRecipe({ variant });
|
|
19
11
|
return /* @__PURE__ */ jsx(Component, {
|
|
20
12
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.vanilla.js","names":[],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Skeleton.vanilla.js","names":[],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { skeletonRecipe } from './Skeleton.vanilla.css';\n\ntype SkeletonRecipeVariants = RecipeVariantProps<typeof skeletonRecipe>;\n\ninterface SkeletonVanillaOwnProps extends SkeletonRecipeVariants, CSSProps {}\n\nexport type SkeletonVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SkeletonVanillaOwnProps\n>;\n\ntype SkeletonVanillaComponent = PolymorphicComponent<'div', SkeletonVanillaProps<ElementType>>;\n\nconst SkeletonVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: SkeletonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = skeletonRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nSkeletonVanillaImpl.displayName = 'SkeletonVanilla';\n\nexport const SkeletonVanilla = SkeletonVanillaImpl as SkeletonVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,sBAAsB,YAExB,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,eAAe,EAAE,QAAQ,CAAC;CAE9C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,oBAAoB,cAAc;AAElC,IAAa,kBAAkB"}
|