@blockle/blocks 0.8.8 → 0.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/index.cjs +77 -736
  2. package/dist/index.d.mts +1 -0
  3. package/dist/index.mjs +56 -714
  4. package/dist/momotaro.chunk.d.ts +423 -410
  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,246 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useEffect, useLayoutEffect, useRef, useState, useCallback, createContext, useContext } from "react";
3
+ import { useTheme, useComponentStyles, Box, classnames } from "../../display/Divider/Divider.mjs";
4
+ import { backdrop } from "./dialog.css.mjs";
5
+ import { createPortal } from "react-dom";
6
+ import { BlocksProvider } from "../../other/BlocksProvider/BlocksProvider.mjs";
7
+ const Portal = ({ children, container }) => {
8
+ const context = useTheme();
9
+ return createPortal(
10
+ /* @__PURE__ */ jsx(BlocksProvider, { theme: context, children }),
11
+ container || document.body
12
+ );
13
+ };
14
+ const focusableSelectors = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
15
+ const getFirstFocusableElement = (container) => {
16
+ const focusable = container.querySelector(focusableSelectors);
17
+ return focusable || null;
18
+ };
19
+ const focusFirstElement = (container) => {
20
+ const focusable = getFirstFocusableElement(container);
21
+ if (focusable) {
22
+ focusable.focus();
23
+ }
24
+ };
25
+ const useFocusLock = ({ ref, active }) => {
26
+ useEffect(() => {
27
+ if (!active) {
28
+ return;
29
+ }
30
+ const handleFocus = (event) => {
31
+ if (ref.current && event.target instanceof HTMLElement && !ref.current.contains(event.target)) {
32
+ focusFirstElement(ref.current);
33
+ }
34
+ };
35
+ document.addEventListener("focusin", handleFocus);
36
+ return () => {
37
+ document.removeEventListener("focusin", handleFocus);
38
+ };
39
+ }, [active, ref]);
40
+ };
41
+ const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
42
+ const useKeyboard = (key, callback, { enabled = true, type = "keydown" } = {}) => {
43
+ useEffect(() => {
44
+ if (!enabled) {
45
+ return;
46
+ }
47
+ function handleKeyDown(event) {
48
+ if (event.key === key) {
49
+ callback();
50
+ }
51
+ }
52
+ document.addEventListener(type, handleKeyDown);
53
+ return () => {
54
+ document.removeEventListener(type, handleKeyDown);
55
+ };
56
+ }, [callback, enabled, key, type]);
57
+ };
58
+ const useLayer = () => {
59
+ const layerRef = useRef();
60
+ useEffect(
61
+ () => () => {
62
+ if (layerRef.current) {
63
+ layerRef.current.remove();
64
+ layerRef.current = void 0;
65
+ }
66
+ },
67
+ []
68
+ );
69
+ return () => {
70
+ if (!layerRef.current) {
71
+ const div = document.createElement("div");
72
+ div.dataset.layer = "blocks";
73
+ layerRef.current = div;
74
+ document.body.append(layerRef.current);
75
+ }
76
+ return layerRef.current;
77
+ };
78
+ };
79
+ const usePreventBodyScroll = (enabled = true) => {
80
+ useIsomorphicLayoutEffect(() => {
81
+ if (!enabled) {
82
+ return;
83
+ }
84
+ const prevOverflow = document.body.style.getPropertyValue("overflow");
85
+ const prevScrollTop = document.documentElement.scrollTop;
86
+ if (document.body.scrollHeight > window.innerHeight) {
87
+ document.body.style.position = "fixed";
88
+ document.body.style.overflow = "hidden";
89
+ document.body.style.overflowY = "scroll";
90
+ document.body.style.width = "100%";
91
+ document.body.style.top = `-${prevScrollTop}px`;
92
+ } else {
93
+ document.body.style.overflow = "hidden";
94
+ }
95
+ return () => {
96
+ document.body.style.position = "";
97
+ document.body.style.overflow = prevOverflow;
98
+ document.body.style.overflowY = "";
99
+ document.body.style.width = "";
100
+ document.body.style.top = "";
101
+ document.documentElement.scrollTop = prevScrollTop;
102
+ };
103
+ }, [enabled]);
104
+ };
105
+ const isBrowser = typeof window !== "undefined";
106
+ const useRestoreFocus = (active) => {
107
+ const target = useRef(null);
108
+ if (isBrowser && active && !target.current) {
109
+ target.current = document.activeElement;
110
+ }
111
+ useEffect(() => {
112
+ if (target.current && !active && target.current instanceof HTMLElement) {
113
+ target.current.focus();
114
+ }
115
+ if (!active) {
116
+ target.current = null;
117
+ }
118
+ }, [active]);
119
+ };
120
+ const useVisibilityState = (open) => {
121
+ const [visible, setVisible] = useState(open);
122
+ const hide = useCallback(() => {
123
+ setVisible(false);
124
+ }, []);
125
+ useEffect(() => {
126
+ if (open) {
127
+ setVisible(true);
128
+ }
129
+ }, [open]);
130
+ return [visible, hide];
131
+ };
132
+ function hasAnimationDuration(element) {
133
+ if (!element) {
134
+ return false;
135
+ }
136
+ const style = window.getComputedStyle(element);
137
+ return style.transitionDuration !== "0s" || style.animationDuration !== "0s";
138
+ }
139
+ const DialogContext = createContext(void 0);
140
+ const useNestedDialog = (open) => {
141
+ const parentDialog = useContext(DialogContext);
142
+ useEffect(() => {
143
+ if (!parentDialog || !open) {
144
+ return;
145
+ }
146
+ parentDialog.setEnabled(false);
147
+ return () => {
148
+ parentDialog.setEnabled(true);
149
+ };
150
+ }, [parentDialog, open]);
151
+ return !!parentDialog;
152
+ };
153
+ const Dialog = ({
154
+ children,
155
+ open,
156
+ className,
157
+ onRequestClose,
158
+ size,
159
+ ...restProps
160
+ }) => {
161
+ const backdropClassName = useComponentStyles("dialog", { backdrop: true }, false);
162
+ const dialogClassName = useComponentStyles("dialog", { dialog: true, variants: { size } });
163
+ const backdropRef = useRef(null);
164
+ const dialogRef = useRef(null);
165
+ const layer = useLayer();
166
+ const [visible, hide] = useVisibilityState(open);
167
+ const [enabled, setEnabled] = useState(true);
168
+ const onBackdropClick = useCallback(
169
+ (event) => {
170
+ if (event.target === event.currentTarget) {
171
+ onRequestClose();
172
+ }
173
+ },
174
+ [onRequestClose]
175
+ );
176
+ useFocusLock({ ref: dialogRef, active: open && enabled });
177
+ useRestoreFocus(open);
178
+ const isNested = useNestedDialog(visible);
179
+ usePreventBodyScroll(visible && !isNested);
180
+ useKeyboard("Escape", onRequestClose, { enabled: open && enabled });
181
+ useIsomorphicLayoutEffect(() => {
182
+ var _a, _b;
183
+ if (!open) {
184
+ (_a = backdropRef.current) == null ? void 0 : _a.removeAttribute("data-open");
185
+ (_b = dialogRef.current) == null ? void 0 : _b.removeAttribute("data-open");
186
+ return;
187
+ }
188
+ let timer = requestAnimationFrame(() => {
189
+ timer = requestAnimationFrame(() => {
190
+ var _a2, _b2;
191
+ (_a2 = backdropRef.current) == null ? void 0 : _a2.setAttribute("data-open", "");
192
+ (_b2 = dialogRef.current) == null ? void 0 : _b2.setAttribute("data-open", "");
193
+ });
194
+ });
195
+ return () => {
196
+ cancelAnimationFrame(timer);
197
+ };
198
+ }, [open, visible]);
199
+ const onAnimationEnd = useCallback(() => {
200
+ if (!open) {
201
+ hide();
202
+ }
203
+ }, [hide, open]);
204
+ useEffect(() => {
205
+ if (open) {
206
+ return;
207
+ }
208
+ if (!hasAnimationDuration(dialogRef.current)) {
209
+ hide();
210
+ }
211
+ }, [hide, open]);
212
+ if (!visible) {
213
+ return null;
214
+ }
215
+ const dataOpen = typeof window === "undefined" && open ? "" : void 0;
216
+ return /* @__PURE__ */ jsx(Portal, { container: layer(), children: /* @__PURE__ */ jsx(DialogContext.Provider, { value: { setEnabled }, children: /* @__PURE__ */ jsx(
217
+ Box,
218
+ {
219
+ ref: backdropRef,
220
+ className: classnames(backdrop, backdropClassName),
221
+ "data-open": dataOpen,
222
+ onClick: onBackdropClick,
223
+ onAnimationEnd,
224
+ onTransitionEnd: onAnimationEnd,
225
+ children: /* @__PURE__ */ jsx(
226
+ "dialog",
227
+ {
228
+ ref: dialogRef,
229
+ "aria-modal": "true",
230
+ open: true,
231
+ "data-open": dataOpen,
232
+ className: classnames(dialogClassName, className),
233
+ ...restProps,
234
+ children
235
+ }
236
+ )
237
+ }
238
+ ) }) });
239
+ };
240
+ export {
241
+ Dialog,
242
+ Portal,
243
+ useIsomorphicLayoutEffect,
244
+ useKeyboard,
245
+ usePreventBodyScroll
246
+ };
@@ -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/Dialog/dialog.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/overlay/Dialog/dialog.css.ts", "blocks");
6
6
  const backdrop = 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/Dialog/dialog.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/overlay/Dialog/dialog.css.ts", "blocks");
5
5
  const backdrop = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const styles_components_display_Divider_Divider_cjs = require("../../display/Divider/Divider.cjs");
4
+ const styles_components_typography_Heading_heading_css_cjs = require("./heading.css.cjs");
5
+ const Heading = ({
6
+ className,
7
+ level = 1,
8
+ children,
9
+ ...restProps
10
+ }) => {
11
+ const Tag = `h${level}`;
12
+ return /* @__PURE__ */ jsxRuntime.jsx(styles_components_display_Divider_Divider_cjs.Box, { asChild: true, className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_typography_Heading_heading_css_cjs.heading, className), ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(Tag, { children }) });
13
+ };
14
+ exports.Heading = Heading;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Box, classnames } from "../../display/Divider/Divider.mjs";
3
+ import { heading } from "./heading.css.mjs";
4
+ const Heading = ({
5
+ className,
6
+ level = 1,
7
+ children,
8
+ ...restProps
9
+ }) => {
10
+ const Tag = `h${level}`;
11
+ return /* @__PURE__ */ jsx(Box, { asChild: true, className: classnames(heading, className), ...restProps, children: /* @__PURE__ */ jsx(Tag, { children }) });
12
+ };
13
+ export {
14
+ Heading
15
+ };
@@ -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/Heading/heading.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/typography/Heading/heading.css.ts", "blocks");
6
6
  const heading = 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/Heading/heading.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/typography/Heading/heading.css.ts", "blocks");
5
5
  const heading = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1,9 @@
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_typography_Text_text_css_cjs = require("./text.css.cjs");
6
+ const Text = react.forwardRef(function Text2({ tag: Tag = "span", asChild, children, className, ...restProps }, ref) {
7
+ return /* @__PURE__ */ jsxRuntime.jsx(styles_components_display_Divider_Divider_cjs.Box, { ref, asChild: true, className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_typography_Text_text_css_cjs.text, className), ...restProps, children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsx(Tag, { children }) });
8
+ });
9
+ exports.Text = Text;
@@ -0,0 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Box, classnames } from "../../display/Divider/Divider.mjs";
4
+ import { text } from "./text.css.mjs";
5
+ const Text = forwardRef(function Text2({ tag: Tag = "span", asChild, children, className, ...restProps }, ref) {
6
+ return /* @__PURE__ */ jsx(Box, { ref, asChild: true, className: classnames(text, className), ...restProps, children: asChild ? children : /* @__PURE__ */ jsx(Tag, { children }) });
7
+ });
8
+ export {
9
+ Text
10
+ };
@@ -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/Text/text.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/typography/Text/text.css.ts", "blocks");
6
6
  const text = 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/Text/text.css.ts?used", "blocks");
3
+ import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
+ setFileScope("src/components/typography/Text/text.css.ts", "blocks");
5
5
  const text = style({
6
6
  "@layer": {
7
7
  [blocksLayer]: {
@@ -0,0 +1 @@
1
+ "use strict";
@@ -3,7 +3,7 @@ const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const sprinkles = require("@vanilla-extract/sprinkles");
4
4
  const styles_lib_css_atoms_atomicProperties_cjs = require("./atomicProperties.cjs");
5
5
  const styles_lib_css_atoms_breakpoints_cjs = require("./breakpoints.cjs");
6
- fileScope.setFileScope("src/lib/css/atoms/sprinkles.css.ts?used", "blocks");
6
+ fileScope.setFileScope("src/lib/css/atoms/sprinkles.css.ts", "blocks");
7
7
  const unresponsiveAtomicProperties = sprinkles.defineProperties({
8
8
  properties: styles_lib_css_atoms_atomicProperties_cjs.unresponsiveProperties,
9
9
  shorthands: {
@@ -36,10 +36,6 @@ const responsiveAtomicProperties = sprinkles.defineProperties({
36
36
  placeItems: ["justifyContent", "alignItems"]
37
37
  }
38
38
  });
39
- const atoms = sprinkles.createSprinkles(
40
- unresponsiveAtomicProperties,
41
- responsiveAtomicProperties
42
- // colorAtomicProperties,
43
- );
39
+ const atoms = sprinkles.createSprinkles(unresponsiveAtomicProperties, responsiveAtomicProperties);
44
40
  fileScope.endFileScope();
45
41
  exports.atoms = atoms;
@@ -2,7 +2,7 @@ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { defineProperties, createSprinkles } from "@vanilla-extract/sprinkles";
3
3
  import { unresponsiveProperties, responsiveProperties } from "./atomicProperties.mjs";
4
4
  import { breakpointQuery, breakpointNames } from "./breakpoints.mjs";
5
- setFileScope("src/lib/css/atoms/sprinkles.css.ts?used", "blocks");
5
+ setFileScope("src/lib/css/atoms/sprinkles.css.ts", "blocks");
6
6
  const unresponsiveAtomicProperties = defineProperties({
7
7
  properties: unresponsiveProperties,
8
8
  shorthands: {
@@ -35,11 +35,7 @@ const responsiveAtomicProperties = defineProperties({
35
35
  placeItems: ["justifyContent", "alignItems"]
36
36
  }
37
37
  });
38
- const atoms = createSprinkles(
39
- unresponsiveAtomicProperties,
40
- responsiveAtomicProperties
41
- // colorAtomicProperties,
42
- );
38
+ const atoms = createSprinkles(unresponsiveAtomicProperties, responsiveAtomicProperties);
43
39
  endFileScope();
44
40
  export {
45
41
  atoms
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
- fileScope.setFileScope("src/lib/css/layers/layers.css.ts?used", "blocks");
4
+ fileScope.setFileScope("src/lib/css/layers/layers.css.ts", "blocks");
5
5
  const blocksLayer = css.layer("blockle-blocks");
6
6
  fileScope.endFileScope();
7
7
  exports.blocksLayer = blocksLayer;
@@ -1,6 +1,6 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { layer } from "@vanilla-extract/css";
3
- setFileScope("src/lib/css/layers/layers.css.ts?used", "blocks");
3
+ setFileScope("src/lib/css/layers/layers.css.ts", "blocks");
4
4
  const blocksLayer = layer("blockle-blocks");
5
5
  endFileScope();
6
6
  export {
@@ -3,7 +3,7 @@ const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
4
  const styles_lib_theme_makeVanillaTheme_cjs = require("./makeVanillaTheme.cjs");
5
5
  const styles_lib_theme_tokens_cjs = require("./tokens.cjs");
6
- fileScope.setFileScope("src/lib/theme/vars.css.ts?used", "blocks");
6
+ fileScope.setFileScope("src/lib/theme/vars.css.ts", "blocks");
7
7
  const vars = css.createThemeContract(styles_lib_theme_makeVanillaTheme_cjs.makeVanillaTheme(styles_lib_theme_tokens_cjs.tokens));
8
8
  fileScope.endFileScope();
9
9
  exports.vars = vars;
@@ -2,7 +2,7 @@ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { createThemeContract } from "@vanilla-extract/css";
3
3
  import { makeVanillaTheme } from "./makeVanillaTheme.mjs";
4
4
  import { tokens } from "./tokens.mjs";
5
- setFileScope("src/lib/theme/vars.css.ts?used", "blocks");
5
+ setFileScope("src/lib/theme/vars.css.ts", "blocks");
6
6
  const vars = createThemeContract(makeVanillaTheme(tokens));
7
7
  endFileScope();
8
8
  export {
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ const styles_lib_css_atoms_sprinkles_css_cjs = require("../css/atoms/sprinkles.css.cjs");
3
+ function getAtomsAndProps(props) {
4
+ const atomProps = {};
5
+ const otherProps = {};
6
+ for (const [name, value] of Object.entries(props)) {
7
+ if (styles_lib_css_atoms_sprinkles_css_cjs.atoms.properties.has(name)) {
8
+ atomProps[name] = value;
9
+ } else {
10
+ otherProps[name] = value;
11
+ }
12
+ }
13
+ return [atomProps, otherProps];
14
+ }
15
+ exports.getAtomsAndProps = getAtomsAndProps;
@@ -0,0 +1,16 @@
1
+ import { atoms } from "../css/atoms/sprinkles.css.mjs";
2
+ function getAtomsAndProps(props) {
3
+ const atomProps = {};
4
+ const otherProps = {};
5
+ for (const [name, value] of Object.entries(props)) {
6
+ if (atoms.properties.has(name)) {
7
+ atomProps[name] = value;
8
+ } else {
9
+ otherProps[name] = value;
10
+ }
11
+ }
12
+ return [atomProps, otherProps];
13
+ }
14
+ export {
15
+ getAtomsAndProps
16
+ };
@@ -5,7 +5,7 @@ const styles_lib_css_style_style_cjs = require("../../../lib/css/style/style.cjs
5
5
  const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
6
6
  const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
7
7
  const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
8
- fileScope.setFileScope("src/themes/momotaro/components/button.css.ts?used", "blocks");
8
+ fileScope.setFileScope("src/themes/momotaro/components/button.css.ts", "blocks");
9
9
  const intentColor = css.createVar("intentColor");
10
10
  const hoverBackgroundColor = css.createVar("hoverBackgroundColor");
11
11
  const button = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("button", {
@@ -4,7 +4,7 @@ import { style } from "../../../lib/css/style/style.mjs";
4
4
  import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
5
5
  import { vars } from "../../../lib/theme/vars.css.mjs";
6
6
  import { clickable, focusRingColor } from "./helpers.css.mjs";
7
- setFileScope("src/themes/momotaro/components/button.css.ts?used", "blocks");
7
+ setFileScope("src/themes/momotaro/components/button.css.ts", "blocks");
8
8
  const intentColor = createVar("intentColor");
9
9
  const hoverBackgroundColor = createVar("hoverBackgroundColor");
10
10
  const button = makeComponentTheme("button", {
@@ -6,7 +6,7 @@ const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs")
6
6
  const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
7
7
  const styles_themes_momotaro_components_transitions_cjs = require("./transitions.cjs");
8
8
  const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
9
- fileScope.setFileScope("src/themes/momotaro/components/checkbox.css.ts?used", "blocks");
9
+ fileScope.setFileScope("src/themes/momotaro/components/checkbox.css.ts", "blocks");
10
10
  const checkbox = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("checkbox", {
11
11
  base: css.style([{
12
12
  display: "flex",
@@ -5,7 +5,7 @@ import { vars } from "../../../lib/theme/vars.css.mjs";
5
5
  import { focusable } from "./helpers.css.mjs";
6
6
  import { bounceOut } from "./transitions.mjs";
7
7
  import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
8
- setFileScope("src/themes/momotaro/components/checkbox.css.ts?used", "blocks");
8
+ setFileScope("src/themes/momotaro/components/checkbox.css.ts", "blocks");
9
9
  const checkbox = makeComponentTheme("checkbox", {
10
10
  base: style([{
11
11
  display: "flex",
@@ -3,7 +3,7 @@ const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const css = require("@vanilla-extract/css");
4
4
  const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
5
5
  const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
6
- fileScope.setFileScope("src/themes/momotaro/components/dialog.css.ts?used", "blocks");
6
+ fileScope.setFileScope("src/themes/momotaro/components/dialog.css.ts", "blocks");
7
7
  const dialog = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("dialog", {
8
8
  dialog: css.style([styles_lib_css_atoms_sprinkles_css_cjs.atoms({
9
9
  display: "flex",
@@ -2,7 +2,7 @@ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { style } from "@vanilla-extract/css";
3
3
  import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
4
4
  import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
5
- setFileScope("src/themes/momotaro/components/dialog.css.ts?used", "blocks");
5
+ setFileScope("src/themes/momotaro/components/dialog.css.ts", "blocks");
6
6
  const dialog = makeComponentTheme("dialog", {
7
7
  dialog: style([atoms({
8
8
  display: "flex",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
4
- fileScope.setFileScope("src/themes/momotaro/components/divider.css.ts?used", "blocks");
4
+ fileScope.setFileScope("src/themes/momotaro/components/divider.css.ts", "blocks");
5
5
  const divider = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("divider", {
6
6
  defaultVariants: {
7
7
  color: "textLight"
@@ -1,6 +1,6 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
2
  import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
3
- setFileScope("src/themes/momotaro/components/divider.css.ts?used", "blocks");
3
+ setFileScope("src/themes/momotaro/components/divider.css.ts", "blocks");
4
4
  const divider = makeComponentTheme("divider", {
5
5
  defaultVariants: {
6
6
  color: "textLight"
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ const fileScope = require("@vanilla-extract/css/fileScope");
3
+ const styles_lib_css_style_style_cjs = require("../../../lib/css/style/style.cjs");
4
+ const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
5
+ fileScope.setFileScope("src/themes/momotaro/components/dropdown.css.ts", "blocks");
6
+ const dropdown = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("dropdown", {
7
+ base: styles_lib_css_style_style_cjs.style({
8
+ backgroundColor: "white",
9
+ borderRadius: "small",
10
+ boxShadow: "medium",
11
+ padding: "medium",
12
+ vars: {
13
+ "--spacing": "0.5rem"
14
+ },
15
+ selectors: {
16
+ "&[data-open]": {
17
+ transform: "translate(0, 0)",
18
+ opacity: 1
19
+ }
20
+ },
21
+ // Apply the animation only if the user has not requested reduced motion
22
+ "@media": {
23
+ "(prefers-reduced-motion: no-preference)": {
24
+ // transform: 'scale(0.9)',
25
+ transform: "translateY(var(--spacing))",
26
+ transition: "opacity 80ms linear, transform 80ms",
27
+ opacity: 0
28
+ }
29
+ }
30
+ }),
31
+ variants: {
32
+ variant: {
33
+ solid: styles_lib_css_style_style_cjs.style({
34
+ backgroundColor: "white",
35
+ border: "none",
36
+ boxShadow: "medium",
37
+ color: "black",
38
+ padding: "medium"
39
+ }),
40
+ outline: styles_lib_css_style_style_cjs.style({
41
+ backgroundColor: "transparent",
42
+ border: "1px solid black",
43
+ boxShadow: "none",
44
+ color: "black",
45
+ padding: "medium"
46
+ })
47
+ }
48
+ },
49
+ defaultVariants: {
50
+ variant: "solid"
51
+ }
52
+ });
53
+ fileScope.endFileScope();
54
+ exports.dropdown = dropdown;