@blockle/blocks 0.8.8 → 0.8.10

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.
Files changed (90) hide show
  1. package/dist/index.cjs +79 -738
  2. package/dist/index.d.mts +1 -0
  3. package/dist/index.mjs +58 -716
  4. package/dist/momotaro.chunk.d.ts +159 -146
  5. package/dist/reset.css.d.mts +2 -0
  6. package/dist/reset.css.d.ts +1 -1
  7. package/dist/styles/components/display/Divider/Divider.cjs +226 -0
  8. package/dist/styles/components/display/Divider/Divider.mjs +227 -0
  9. package/dist/styles/components/{Divider → display/Divider}/divider.css.cjs +2 -2
  10. package/dist/styles/components/{Divider → display/Divider}/divider.css.mjs +2 -2
  11. package/dist/styles/components/form/Button/Button.cjs +55 -0
  12. package/dist/styles/components/{Button → form/Button}/Button.css.cjs +2 -2
  13. package/dist/styles/components/{Button → form/Button}/Button.css.mjs +2 -2
  14. package/dist/styles/components/form/Button/Button.mjs +56 -0
  15. package/dist/styles/components/form/Checkbox/Checkbox.cjs +47 -0
  16. package/dist/styles/components/form/Checkbox/Checkbox.mjs +48 -0
  17. package/dist/styles/components/{Checkbox → form/Checkbox}/checkbox.css.cjs +2 -2
  18. package/dist/styles/components/{Checkbox → form/Checkbox}/checkbox.css.mjs +2 -2
  19. package/dist/styles/components/form/Input/Input.cjs +27 -0
  20. package/dist/styles/components/form/Input/Input.mjs +28 -0
  21. package/dist/styles/components/{Input → form/Input}/input.css.cjs +2 -2
  22. package/dist/styles/components/{Input → form/Input}/input.css.mjs +2 -2
  23. package/dist/styles/components/form/Radio/Radio.cjs +23 -0
  24. package/dist/styles/components/form/Radio/Radio.mjs +24 -0
  25. package/dist/styles/components/{Radio → form/Radio}/radio.css.cjs +2 -2
  26. package/dist/styles/components/{Radio → form/Radio}/radio.css.mjs +2 -2
  27. package/dist/styles/components/form/Switch/Switch.cjs +61 -0
  28. package/dist/styles/components/form/Switch/Switch.mjs +62 -0
  29. package/dist/styles/components/{Switch → form/Switch}/switch.css.cjs +2 -2
  30. package/dist/styles/components/{Switch → form/Switch}/switch.css.mjs +2 -2
  31. package/dist/styles/components/other/BlocksProvider/BlocksProvider.cjs +20 -0
  32. package/dist/styles/components/other/BlocksProvider/BlocksProvider.mjs +21 -0
  33. package/dist/styles/components/overlay/Dialog/Dialog.cjs +245 -0
  34. package/dist/styles/components/overlay/Dialog/Dialog.mjs +246 -0
  35. package/dist/styles/components/{Dialog → overlay/Dialog}/dialog.css.cjs +2 -2
  36. package/dist/styles/components/{Dialog → overlay/Dialog}/dialog.css.mjs +2 -2
  37. package/dist/styles/components/typography/Heading/Heading.cjs +14 -0
  38. package/dist/styles/components/typography/Heading/Heading.mjs +15 -0
  39. package/dist/styles/components/{Heading → typography/Heading}/heading.css.cjs +2 -2
  40. package/dist/styles/components/{Heading → typography/Heading}/heading.css.mjs +2 -2
  41. package/dist/styles/components/typography/Text/Text.cjs +9 -0
  42. package/dist/styles/components/typography/Text/Text.mjs +10 -0
  43. package/dist/styles/components/{Text → typography/Text}/text.css.cjs +2 -2
  44. package/dist/styles/components/{Text → typography/Text}/text.css.mjs +2 -2
  45. package/dist/styles/lib/css/atoms/atoms.cjs +1 -0
  46. package/dist/styles/lib/css/atoms/atoms.mjs +1 -0
  47. package/dist/styles/lib/css/atoms/sprinkles.css.cjs +2 -6
  48. package/dist/styles/lib/css/atoms/sprinkles.css.mjs +2 -6
  49. package/dist/styles/lib/css/layers/layers.css.cjs +1 -1
  50. package/dist/styles/lib/css/layers/layers.css.mjs +1 -1
  51. package/dist/styles/lib/theme/vars.css.cjs +1 -1
  52. package/dist/styles/lib/theme/vars.css.mjs +1 -1
  53. package/dist/styles/lib/utils/atom-props.cjs +15 -0
  54. package/dist/styles/lib/utils/atom-props.mjs +16 -0
  55. package/dist/styles/themes/momotaro/components/button.css.cjs +1 -1
  56. package/dist/styles/themes/momotaro/components/button.css.mjs +1 -1
  57. package/dist/styles/themes/momotaro/components/checkbox.css.cjs +1 -1
  58. package/dist/styles/themes/momotaro/components/checkbox.css.mjs +1 -1
  59. package/dist/styles/themes/momotaro/components/dialog.css.cjs +1 -1
  60. package/dist/styles/themes/momotaro/components/dialog.css.mjs +1 -1
  61. package/dist/styles/themes/momotaro/components/divider.css.cjs +1 -1
  62. package/dist/styles/themes/momotaro/components/divider.css.mjs +1 -1
  63. package/dist/styles/themes/momotaro/components/dropdown.css.cjs +54 -0
  64. package/dist/styles/themes/momotaro/components/dropdown.css.mjs +55 -0
  65. package/dist/styles/themes/momotaro/components/helpers.css.cjs +1 -1
  66. package/dist/styles/themes/momotaro/components/helpers.css.mjs +1 -1
  67. package/dist/styles/themes/momotaro/components/index.cjs +2 -0
  68. package/dist/styles/themes/momotaro/components/index.mjs +2 -0
  69. package/dist/styles/themes/momotaro/components/input.css.cjs +1 -1
  70. package/dist/styles/themes/momotaro/components/input.css.mjs +1 -1
  71. package/dist/styles/themes/momotaro/components/label.css.cjs +1 -1
  72. package/dist/styles/themes/momotaro/components/label.css.mjs +1 -1
  73. package/dist/styles/themes/momotaro/components/link.css.cjs +1 -1
  74. package/dist/styles/themes/momotaro/components/link.css.mjs +1 -1
  75. package/dist/styles/themes/momotaro/components/progress.css.cjs +1 -1
  76. package/dist/styles/themes/momotaro/components/progress.css.mjs +1 -1
  77. package/dist/styles/themes/momotaro/components/radio.css.cjs +1 -1
  78. package/dist/styles/themes/momotaro/components/radio.css.mjs +1 -1
  79. package/dist/styles/themes/momotaro/components/spinner.css.cjs +1 -1
  80. package/dist/styles/themes/momotaro/components/spinner.css.mjs +1 -1
  81. package/dist/styles/themes/momotaro/components/switch.css.cjs +1 -1
  82. package/dist/styles/themes/momotaro/components/switch.css.mjs +1 -1
  83. package/dist/styles/themes/momotaro/index.cjs +1 -0
  84. package/dist/styles/themes/momotaro/index.mjs +1 -0
  85. package/dist/styles/themes/momotaro/momotaro.css.cjs +1 -1
  86. package/dist/styles/themes/momotaro/momotaro.css.mjs +1 -1
  87. package/dist/styles/themes/momotaro/tokens.css.cjs +1 -1
  88. package/dist/styles/themes/momotaro/tokens.css.mjs +1 -1
  89. package/dist/themes/momotaro.d.mts +1 -0
  90. package/package.json +47 -37
@@ -0,0 +1,227 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { divider } from "./divider.css.mjs";
3
+ import { createContext, useContext, forwardRef, Children, isValidElement, cloneElement } from "react";
4
+ import { getAtomsAndProps } from "../../../lib/utils/atom-props.mjs";
5
+ import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
6
+ const BlocksProviderContext = createContext(null);
7
+ const useTheme = () => {
8
+ const theme = useContext(BlocksProviderContext);
9
+ if (!theme) {
10
+ throw new Error("useTheme must be used within a BlocksProvider");
11
+ }
12
+ return theme;
13
+ };
14
+ function useComponentStyles(name, props, useDefaultVariants = true) {
15
+ const { components } = useTheme();
16
+ const component = components[name];
17
+ if (!component) {
18
+ console.warn(`Component ${name} is not defined in the theme`);
19
+ return "";
20
+ }
21
+ const classNames = [];
22
+ const variants = props.variants ?? {};
23
+ const variantsWithDefaults = { ...variants };
24
+ for (const key in props) {
25
+ const value = props[key];
26
+ if (typeof value === "boolean" && value) {
27
+ classNames.push(component[key]);
28
+ }
29
+ }
30
+ if (!component.variants) {
31
+ return classNames.join(" ");
32
+ }
33
+ const { defaultVariants } = component;
34
+ if (useDefaultVariants && defaultVariants) {
35
+ const keys2 = Object.keys(defaultVariants);
36
+ for (const key of keys2) {
37
+ if (variantsWithDefaults[key] === void 0 && defaultVariants[key]) {
38
+ variantsWithDefaults[key] = defaultVariants[key];
39
+ }
40
+ }
41
+ }
42
+ const keys = Object.keys(variantsWithDefaults);
43
+ const componentVariants = component.variants;
44
+ for (const key of keys) {
45
+ const value = variantsWithDefaults[key];
46
+ if (value === void 0 || componentVariants[key] === void 0) {
47
+ continue;
48
+ }
49
+ if (typeof value === "boolean") {
50
+ if (value && componentVariants[key]) {
51
+ classNames.push(componentVariants[key]);
52
+ }
53
+ continue;
54
+ }
55
+ const variant = componentVariants[key][value];
56
+ if (variant) {
57
+ classNames.push(variant);
58
+ }
59
+ }
60
+ const { compoundVariants } = component;
61
+ if (compoundVariants) {
62
+ for (const compoundVariant of compoundVariants) {
63
+ const keys2 = Object.keys(compoundVariant.variants);
64
+ const matches = keys2.every((key) => {
65
+ const value = variantsWithDefaults[key];
66
+ if (value === void 0) {
67
+ return false;
68
+ }
69
+ return value === compoundVariant.variants[key];
70
+ });
71
+ if (matches) {
72
+ classNames.push(compoundVariant.style);
73
+ }
74
+ }
75
+ }
76
+ return classNames.join(" ");
77
+ }
78
+ const useComponentStyleDefaultProps = (name) => {
79
+ const { components } = useTheme();
80
+ const component = components[name];
81
+ if (!component) {
82
+ return {};
83
+ }
84
+ return component.defaultVariants ?? {};
85
+ };
86
+ const classnames = (...args) => {
87
+ const className = args.filter((arg) => arg && typeof arg === "string").join(" ");
88
+ return className || void 0;
89
+ };
90
+ function setRef(ref, value) {
91
+ if (typeof ref === "function") {
92
+ ref(value);
93
+ } else if (ref !== null && ref !== void 0) {
94
+ ref.current = value;
95
+ }
96
+ }
97
+ function composeRefs(...refs) {
98
+ return (node) => {
99
+ for (const ref of refs) {
100
+ setRef(ref, node);
101
+ }
102
+ };
103
+ }
104
+ function mergeProps(slotProps, childProps) {
105
+ const overrideProps = {};
106
+ for (const propName in childProps) {
107
+ const slotPropValue = slotProps[propName];
108
+ const childPropValue = childProps[propName];
109
+ if (childPropValue === void 0) {
110
+ continue;
111
+ }
112
+ if (slotPropValue === void 0) {
113
+ overrideProps[propName] = childPropValue;
114
+ continue;
115
+ }
116
+ if (typeof slotPropValue === "function" && typeof childPropValue === "function") {
117
+ overrideProps[propName] = (...args) => {
118
+ childPropValue(...args);
119
+ slotPropValue(...args);
120
+ };
121
+ } else if (propName === "style") {
122
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
123
+ } else if (propName === "className") {
124
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
125
+ } else {
126
+ overrideProps[propName] = childPropValue;
127
+ }
128
+ }
129
+ return { ...slotProps, ...overrideProps };
130
+ }
131
+ function createSlottable(defaultElement) {
132
+ function Slottable2(props, ref) {
133
+ const { asChild, children, ...slotProps } = props;
134
+ const Component = defaultElement;
135
+ if (!asChild) {
136
+ return /* @__PURE__ */ jsx(Component, { ref, ...slotProps, children });
137
+ }
138
+ const childrenArray = Children.toArray(children);
139
+ const slot = childrenArray.find((child) => {
140
+ if (!isValidElement(child)) {
141
+ return false;
142
+ }
143
+ return child.type === Slot;
144
+ });
145
+ if (!slot) {
146
+ const Slot2 = childrenArray[0];
147
+ if (!isValidElement(childrenArray[0])) {
148
+ if (process.env.NODE_ENV === "development") {
149
+ console.warn("Slottable: First child is not a valid React element");
150
+ }
151
+ return null;
152
+ }
153
+ if (!isValidElement(Slot2)) {
154
+ return null;
155
+ }
156
+ return cloneElement(
157
+ Slot2,
158
+ {
159
+ ...mergeProps(slotProps, Slot2.props),
160
+ ref: composeRefs(ref, Slot2.ref)
161
+ },
162
+ Slot2.props.children
163
+ );
164
+ }
165
+ if (!isValidElement(slot) || !isValidElement(slot.props.children)) {
166
+ return null;
167
+ }
168
+ const newChildren = childrenArray.map((child) => {
169
+ if (!isValidElement(child)) {
170
+ return child;
171
+ }
172
+ if (child.type === Slot) {
173
+ return slot.props.children.props.children;
174
+ }
175
+ return child;
176
+ });
177
+ return cloneElement(
178
+ slot.props.children,
179
+ {
180
+ ...mergeProps(slotProps, slot.props),
181
+ ref: composeRefs(ref, slot.props.children.ref)
182
+ },
183
+ newChildren
184
+ );
185
+ }
186
+ return forwardRef(Slottable2);
187
+ }
188
+ const Slot = ({ children }) => children;
189
+ const Slottable = createSlottable("div");
190
+ const Box = forwardRef(function Box2({ asChild, className, children, ...restProps }, ref) {
191
+ const [atomsProps, otherProps] = getAtomsAndProps(restProps);
192
+ return /* @__PURE__ */ jsx(
193
+ Slottable,
194
+ {
195
+ ref,
196
+ asChild,
197
+ className: classnames(className, atoms(atomsProps)),
198
+ ...otherProps,
199
+ children
200
+ }
201
+ );
202
+ });
203
+ const Divider = ({ className, color, ...restProps }) => {
204
+ const dividerClass = useComponentStyles("divider", { base: true });
205
+ const dividerDefaults = useComponentStyleDefaultProps("divider");
206
+ return /* @__PURE__ */ jsx(
207
+ Box,
208
+ {
209
+ role: "separator",
210
+ width: "full",
211
+ backgroundColor: color ?? dividerDefaults.color,
212
+ className: classnames(className, dividerClass, divider),
213
+ ...restProps
214
+ }
215
+ );
216
+ };
217
+ export {
218
+ BlocksProviderContext,
219
+ Box,
220
+ Divider,
221
+ Slot,
222
+ classnames,
223
+ createSlottable,
224
+ useComponentStyleDefaultProps,
225
+ useComponentStyles,
226
+ useTheme
227
+ };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
- const styles_lib_css_layers_layers_css_cjs = require("../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/Divider/divider.css.ts?used", "blocks");
4
+ const styles_lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
+ fileScope.setFileScope("src/components/display/Divider/divider.css.ts", "blocks");
6
6
  const divider = css.style({
7
7
  "@layer": {
8
8
  [styles_lib_css_layers_layers_css_cjs.blocksLayer]: {
@@ -1,7 +1,7 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/Divider/divider.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/display/Divider/divider.css.ts", "blocks");
5
5
  const divider = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const styles_lib_utils_atomProps_cjs = require("../../../lib/utils/atom-props.cjs");
5
+ const styles_components_display_Divider_Divider_cjs = require("../../display/Divider/Divider.cjs");
6
+ const styles_components_form_Button_Button_css_cjs = require("./Button.css.cjs");
7
+ const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
8
+ const Spinner = ({ className, size, color, ...restProps }) => {
9
+ const spinnerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("spinner", { base: true, variants: { size, color } });
10
+ return /* @__PURE__ */ jsxRuntime.jsx(styles_components_display_Divider_Divider_cjs.Box, { color, className: styles_components_display_Divider_Divider_cjs.classnames(spinnerClassName, className), ...restProps });
11
+ };
12
+ const Slottable = styles_components_display_Divider_Divider_cjs.createSlottable("button");
13
+ const Button = react.forwardRef(function Button2({
14
+ children,
15
+ className,
16
+ variant,
17
+ intent,
18
+ size,
19
+ startSlot,
20
+ endSlot,
21
+ loading,
22
+ disabled,
23
+ asChild,
24
+ ...restProps
25
+ }, ref) {
26
+ const buttonClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("button", {
27
+ base: true,
28
+ variants: {
29
+ variant,
30
+ intent,
31
+ size,
32
+ disabled,
33
+ loading
34
+ }
35
+ });
36
+ const [atomsProps, otherProps] = styles_lib_utils_atomProps_cjs.getAtomsAndProps(restProps);
37
+ return /* @__PURE__ */ jsxRuntime.jsxs(
38
+ Slottable,
39
+ {
40
+ ref,
41
+ asChild,
42
+ disabled: disabled || loading,
43
+ className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_form_Button_Button_css_cjs.buttonReset, buttonClassName, styles_lib_css_atoms_sprinkles_css_cjs.atoms(atomsProps), className),
44
+ ...otherProps,
45
+ children: [
46
+ startSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { children: startSlot }),
47
+ loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size }),
48
+ /* @__PURE__ */ jsxRuntime.jsx(styles_components_display_Divider_Divider_cjs.Slot, { children }),
49
+ endSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { children: endSlot })
50
+ ]
51
+ }
52
+ );
53
+ });
54
+ exports.Button = Button;
55
+ exports.Spinner = Spinner;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
- const styles_lib_css_layers_layers_css_cjs = require("../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/Button/Button.css.ts?used", "blocks");
4
+ const styles_lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
+ fileScope.setFileScope("src/components/form/Button/Button.css.ts", "blocks");
6
6
  const buttonReset = css.style({
7
7
  "@layer": {
8
8
  [styles_lib_css_layers_layers_css_cjs.blocksLayer]: {
@@ -1,7 +1,7 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/Button/Button.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/form/Button/Button.css.ts", "blocks");
5
5
  const buttonReset = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1,56 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { getAtomsAndProps } from "../../../lib/utils/atom-props.mjs";
4
+ import { useComponentStyles, Box, classnames, createSlottable, Slot } from "../../display/Divider/Divider.mjs";
5
+ import { buttonReset } from "./Button.css.mjs";
6
+ import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
7
+ const Spinner = ({ className, size, color, ...restProps }) => {
8
+ const spinnerClassName = useComponentStyles("spinner", { base: true, variants: { size, color } });
9
+ return /* @__PURE__ */ jsx(Box, { color, className: classnames(spinnerClassName, className), ...restProps });
10
+ };
11
+ const Slottable = createSlottable("button");
12
+ const Button = forwardRef(function Button2({
13
+ children,
14
+ className,
15
+ variant,
16
+ intent,
17
+ size,
18
+ startSlot,
19
+ endSlot,
20
+ loading,
21
+ disabled,
22
+ asChild,
23
+ ...restProps
24
+ }, ref) {
25
+ const buttonClassName = useComponentStyles("button", {
26
+ base: true,
27
+ variants: {
28
+ variant,
29
+ intent,
30
+ size,
31
+ disabled,
32
+ loading
33
+ }
34
+ });
35
+ const [atomsProps, otherProps] = getAtomsAndProps(restProps);
36
+ return /* @__PURE__ */ jsxs(
37
+ Slottable,
38
+ {
39
+ ref,
40
+ asChild,
41
+ disabled: disabled || loading,
42
+ className: classnames(buttonReset, buttonClassName, atoms(atomsProps), className),
43
+ ...otherProps,
44
+ children: [
45
+ startSlot && /* @__PURE__ */ jsx("div", { children: startSlot }),
46
+ loading && /* @__PURE__ */ jsx(Spinner, { size }),
47
+ /* @__PURE__ */ jsx(Slot, { children }),
48
+ endSlot && /* @__PURE__ */ jsx("div", { children: endSlot })
49
+ ]
50
+ }
51
+ );
52
+ });
53
+ export {
54
+ Button,
55
+ Spinner
56
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const styles_components_display_Divider_Divider_cjs = require("../../display/Divider/Divider.cjs");
5
+ const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
6
+ const styles_components_form_Checkbox_checkbox_css_cjs = require("./checkbox.css.cjs");
7
+ const Label = ({
8
+ asSpan,
9
+ children,
10
+ className,
11
+ required,
12
+ size,
13
+ cursor,
14
+ ...restProps
15
+ }) => {
16
+ const Component = asSpan ? "span" : "label";
17
+ const containerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("label", {
18
+ base: true,
19
+ variants: { required, size }
20
+ });
21
+ return /* @__PURE__ */ jsxRuntime.jsx(
22
+ Component,
23
+ {
24
+ className: styles_components_display_Divider_Divider_cjs.classnames(containerClassName, className, styles_lib_css_atoms_sprinkles_css_cjs.atoms({ cursor })),
25
+ ...restProps,
26
+ children
27
+ }
28
+ );
29
+ };
30
+ const Checkbox = react.forwardRef(function Checkbox2({ name, label, required, className, ...restProps }, ref) {
31
+ const containerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("checkbox", { base: true }, false);
32
+ const iconClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("checkbox", { icon: true }, false);
33
+ const labelClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("checkbox", { label: true }, false);
34
+ const input = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_form_Checkbox_checkbox_css_cjs.container, containerClassName, className), children: [
35
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type: "checkbox", name, className: styles_components_form_Checkbox_checkbox_css_cjs.input, ...restProps }),
36
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_form_Checkbox_checkbox_css_cjs.icon, iconClassName) })
37
+ ] });
38
+ if (!label) {
39
+ return input;
40
+ }
41
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: labelClassName, children: [
42
+ input,
43
+ label && /* @__PURE__ */ jsxRuntime.jsx(Label, { asSpan: true, required, children: label })
44
+ ] });
45
+ });
46
+ exports.Checkbox = Checkbox;
47
+ exports.Label = Label;
@@ -0,0 +1,48 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useComponentStyles, classnames } from "../../display/Divider/Divider.mjs";
4
+ import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
5
+ import { container, input, icon } from "./checkbox.css.mjs";
6
+ const Label = ({
7
+ asSpan,
8
+ children,
9
+ className,
10
+ required,
11
+ size,
12
+ cursor,
13
+ ...restProps
14
+ }) => {
15
+ const Component = asSpan ? "span" : "label";
16
+ const containerClassName = useComponentStyles("label", {
17
+ base: true,
18
+ variants: { required, size }
19
+ });
20
+ return /* @__PURE__ */ jsx(
21
+ Component,
22
+ {
23
+ className: classnames(containerClassName, className, atoms({ cursor })),
24
+ ...restProps,
25
+ children
26
+ }
27
+ );
28
+ };
29
+ const Checkbox = forwardRef(function Checkbox2({ name, label, required, className, ...restProps }, ref) {
30
+ const containerClassName = useComponentStyles("checkbox", { base: true }, false);
31
+ const iconClassName = useComponentStyles("checkbox", { icon: true }, false);
32
+ const labelClassName = useComponentStyles("checkbox", { label: true }, false);
33
+ const input$1 = /* @__PURE__ */ jsxs("div", { className: classnames(container, containerClassName, className), children: [
34
+ /* @__PURE__ */ jsx("input", { ref, type: "checkbox", name, className: input, ...restProps }),
35
+ /* @__PURE__ */ jsx("div", { className: classnames(icon, iconClassName) })
36
+ ] });
37
+ if (!label) {
38
+ return input$1;
39
+ }
40
+ return /* @__PURE__ */ jsxs("label", { className: labelClassName, children: [
41
+ input$1,
42
+ label && /* @__PURE__ */ jsx(Label, { asSpan: true, required, children: label })
43
+ ] });
44
+ });
45
+ export {
46
+ Checkbox,
47
+ Label
48
+ };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
- const styles_lib_css_layers_layers_css_cjs = require("../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/Checkbox/checkbox.css.ts?used", "blocks");
4
+ const styles_lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
+ fileScope.setFileScope("src/components/form/Checkbox/checkbox.css.ts", "blocks");
6
6
  const container = css.style({
7
7
  "@layer": {
8
8
  [styles_lib_css_layers_layers_css_cjs.blocksLayer]: {
@@ -1,7 +1,7 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/Checkbox/checkbox.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/form/Checkbox/checkbox.css.ts", "blocks");
5
5
  const container = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const styles_components_display_Divider_Divider_cjs = require("../../display/Divider/Divider.cjs");
5
+ const styles_components_form_Input_input_css_cjs = require("./input.css.cjs");
6
+ const Input = react.forwardRef(function Input2({ className, name, type = "text", startSlot, endSlot, label, placeholder, ...restProps }, ref) {
7
+ const id = react.useId();
8
+ const containerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("input", { container: true }, false);
9
+ const inputClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("input", { input: true });
10
+ return /* @__PURE__ */ jsxRuntime.jsx(styles_components_display_Divider_Divider_cjs.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(styles_components_display_Divider_Divider_cjs.Box, { display: "flex", alignItems: "center", className: styles_components_display_Divider_Divider_cjs.classnames(containerClassName, className), children: [
11
+ startSlot,
12
+ /* @__PURE__ */ jsxRuntime.jsx(styles_components_display_Divider_Divider_cjs.Box, { asChild: true, width: "full", overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
13
+ "input",
14
+ {
15
+ id,
16
+ ref,
17
+ name,
18
+ type,
19
+ placeholder: placeholder || label,
20
+ className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_form_Input_input_css_cjs.input, inputClassName),
21
+ ...restProps
22
+ }
23
+ ) }),
24
+ endSlot
25
+ ] }) });
26
+ });
27
+ exports.Input = Input;
@@ -0,0 +1,28 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useId } from "react";
3
+ import { useComponentStyles, Box, classnames } from "../../display/Divider/Divider.mjs";
4
+ import { input } from "./input.css.mjs";
5
+ const Input = forwardRef(function Input2({ className, name, type = "text", startSlot, endSlot, label, placeholder, ...restProps }, ref) {
6
+ const id = useId();
7
+ const containerClassName = useComponentStyles("input", { container: true }, false);
8
+ const inputClassName = useComponentStyles("input", { input: true });
9
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", className: classnames(containerClassName, className), children: [
10
+ startSlot,
11
+ /* @__PURE__ */ jsx(Box, { asChild: true, width: "full", overflow: "hidden", children: /* @__PURE__ */ jsx(
12
+ "input",
13
+ {
14
+ id,
15
+ ref,
16
+ name,
17
+ type,
18
+ placeholder: placeholder || label,
19
+ className: classnames(input, inputClassName),
20
+ ...restProps
21
+ }
22
+ ) }),
23
+ endSlot
24
+ ] }) });
25
+ });
26
+ export {
27
+ Input
28
+ };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
- const styles_lib_css_layers_layers_css_cjs = require("../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/Input/input.css.ts?used", "blocks");
4
+ const styles_lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
+ fileScope.setFileScope("src/components/form/Input/input.css.ts", "blocks");
6
6
  const input = css.style({
7
7
  "@layer": {
8
8
  [styles_lib_css_layers_layers_css_cjs.blocksLayer]: {
@@ -1,7 +1,7 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/Input/input.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/form/Input/input.css.ts", "blocks");
5
5
  const input = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const styles_components_display_Divider_Divider_cjs = require("../../display/Divider/Divider.cjs");
5
+ const styles_components_form_Radio_radio_css_cjs = require("./radio.css.cjs");
6
+ const styles_components_form_Checkbox_Checkbox_cjs = require("../Checkbox/Checkbox.cjs");
7
+ const Radio = react.forwardRef(function Checkbox({ name, children, className, ...restProps }, ref) {
8
+ const containerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("radio", { base: true }, false);
9
+ const iconClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("radio", { icon: true }, false);
10
+ const labelClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("checkbox", { label: true }, false);
11
+ const input = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_form_Radio_radio_css_cjs.container, containerClassName, className), children: [
12
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type: "radio", name, className: styles_components_form_Radio_radio_css_cjs.input, ...restProps }),
13
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_form_Radio_radio_css_cjs.icon, iconClassName) })
14
+ ] });
15
+ if (!children) {
16
+ return input;
17
+ }
18
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: labelClassName, children: [
19
+ input,
20
+ /* @__PURE__ */ jsxRuntime.jsx(styles_components_form_Checkbox_Checkbox_cjs.Label, { asSpan: true, children })
21
+ ] });
22
+ });
23
+ exports.Radio = Radio;
@@ -0,0 +1,24 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useComponentStyles, classnames } from "../../display/Divider/Divider.mjs";
4
+ import { container, input, icon } from "./radio.css.mjs";
5
+ import { Label } from "../Checkbox/Checkbox.mjs";
6
+ const Radio = forwardRef(function Checkbox({ name, children, className, ...restProps }, ref) {
7
+ const containerClassName = useComponentStyles("radio", { base: true }, false);
8
+ const iconClassName = useComponentStyles("radio", { icon: true }, false);
9
+ const labelClassName = useComponentStyles("checkbox", { label: true }, false);
10
+ const input$1 = /* @__PURE__ */ jsxs("div", { className: classnames(container, containerClassName, className), children: [
11
+ /* @__PURE__ */ jsx("input", { ref, type: "radio", name, className: input, ...restProps }),
12
+ /* @__PURE__ */ jsx("div", { className: classnames(icon, iconClassName) })
13
+ ] });
14
+ if (!children) {
15
+ return input$1;
16
+ }
17
+ return /* @__PURE__ */ jsxs("label", { className: labelClassName, children: [
18
+ input$1,
19
+ /* @__PURE__ */ jsx(Label, { asSpan: true, children })
20
+ ] });
21
+ });
22
+ export {
23
+ Radio
24
+ };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
- const styles_lib_css_layers_layers_css_cjs = require("../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/Radio/radio.css.ts?used", "blocks");
4
+ const styles_lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
+ fileScope.setFileScope("src/components/form/Radio/radio.css.ts", "blocks");
6
6
  const container = css.style({
7
7
  "@layer": {
8
8
  [styles_lib_css_layers_layers_css_cjs.blocksLayer]: {
@@ -1,7 +1,7 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/Radio/radio.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/form/Radio/radio.css.ts", "blocks");
5
5
  const container = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {