@blockle/blocks 0.11.2 → 0.11.3

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/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ const styles_lib_theme_vars_css_cjs = require("./styles/lib/theme/vars.css.cjs")
8
8
  const styles_components_display_Divider_Divider_cjs = require("./styles/components/display/Divider/Divider.cjs");
9
9
  const styles_lib_css_atoms_sprinkles_css_cjs = require("./styles/lib/css/atoms/sprinkles.css.cjs");
10
10
  const jsxRuntime = require("react/jsx-runtime");
11
- const require$$0 = require("react");
11
+ const react = require("react");
12
12
  const styles_components_form_Button_Button_cjs = require("./styles/components/form/Button/Button.cjs");
13
13
  const styles_components_form_Checkbox_Checkbox_cjs = require("./styles/components/form/Checkbox/Checkbox.cjs");
14
14
  const styles_components_form_Input_Input_cjs = require("./styles/components/form/Input/Input.cjs");
@@ -20,7 +20,7 @@ const styles_components_other_BlocksProvider_BlocksProvider_cjs = require("./sty
20
20
  const styles_components_overlay_Dialog_Dialog_cjs = require("./styles/components/overlay/Dialog/Dialog.cjs");
21
21
  const styles_components_typography_Heading_Heading_cjs = require("./styles/components/typography/Heading/Heading.cjs");
22
22
  const styles_components_typography_Text_Text_cjs = require("./styles/components/typography/Text/Text.cjs");
23
- const Progress = require$$0.forwardRef(function Progress2({ value, max = 100, className, ...restProps }, ref) {
23
+ const Progress = react.forwardRef(function Progress2({ value, max = 100, className, ...restProps }, ref) {
24
24
  const containerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles(
25
25
  "progress",
26
26
  {
@@ -120,7 +120,7 @@ const Stack = ({
120
120
  );
121
121
  };
122
122
  const Slottable = styles_components_display_Divider_Divider_cjs.createSlottable("a");
123
- const Link = require$$0.forwardRef(function Link2({ asChild, className, children, variant, underline, ...restProps }, ref) {
123
+ const Link = react.forwardRef(function Link2({ asChild, className, children, variant, underline, ...restProps }, ref) {
124
124
  const linkClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("link", {
125
125
  base: true,
126
126
  variants: { variant, underline }
@@ -137,7 +137,7 @@ const Link = require$$0.forwardRef(function Link2({ asChild, className, children
137
137
  );
138
138
  });
139
139
  const useClickOutside = (ref, onClickOutside, { enabled = true } = {}) => {
140
- require$$0.useEffect(() => {
140
+ react.useEffect(() => {
141
141
  if (!enabled) {
142
142
  return;
143
143
  }
@@ -210,21 +210,21 @@ const Dropdown = ({
210
210
  }) => {
211
211
  const layer = styles_components_overlay_Dialog_Dialog_cjs.useLayer();
212
212
  const [visible, hide] = styles_components_overlay_Dialog_Dialog_cjs.useVisibilityState(open);
213
- const [position, setPosition] = require$$0.useState({ x: 0, y: 0 });
214
- const dropdownRef = require$$0.useRef(null);
213
+ const [position, setPosition] = react.useState({ x: 0, y: 0 });
214
+ const dropdownRef = react.useRef(null);
215
215
  const containerClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles(
216
216
  "dropdown",
217
217
  { base: true, variants: { variant } },
218
218
  false
219
219
  );
220
- require$$0.useLayoutEffect(() => {
220
+ react.useLayoutEffect(() => {
221
221
  if (!visible) {
222
222
  return;
223
223
  }
224
224
  const position2 = getDropdownPosition(align, anchorElement, dropdownRef);
225
225
  setPosition({ x: position2[0], y: position2[1] });
226
226
  }, [align, anchorElement, visible]);
227
- require$$0.useEffect(() => {
227
+ react.useEffect(() => {
228
228
  if (!open || !repositionOnScroll) {
229
229
  return;
230
230
  }
@@ -255,12 +255,12 @@ const Dropdown = ({
255
255
  cancelAnimationFrame(timer);
256
256
  };
257
257
  }, [open, visible]);
258
- const onAnimationEnd = require$$0.useCallback(() => {
258
+ const onAnimationEnd = react.useCallback(() => {
259
259
  if (!open) {
260
260
  hide();
261
261
  }
262
262
  }, [hide, open]);
263
- require$$0.useEffect(() => {
263
+ react.useEffect(() => {
264
264
  if (open) {
265
265
  return;
266
266
  }
@@ -298,10 +298,10 @@ const Dropdown = ({
298
298
  ) });
299
299
  };
300
300
  const Tooltip = ({ align = "top", children, label }) => {
301
- const id = require$$0.useId();
302
- const ref = require$$0.useRef(null);
303
- const [open, setOpen] = require$$0.useState(false);
304
- require$$0.useEffect(() => {
301
+ const id = react.useId();
302
+ const ref = react.useRef(null);
303
+ const [open, setOpen] = react.useState(false);
304
+ react.useEffect(() => {
305
305
  const element = ref.current;
306
306
  if (!element) {
307
307
  return;
@@ -323,15 +323,15 @@ const Tooltip = ({ align = "top", children, label }) => {
323
323
  element.removeEventListener("focusout", onLeave);
324
324
  };
325
325
  }, [ref, setOpen]);
326
- if (require$$0.Children.count(children) !== 1) {
326
+ if (react.Children.count(children) !== 1) {
327
327
  throw new Error("Tooltip component can only have one child");
328
328
  }
329
- const child = require$$0.Children.toArray(children)[0];
330
- if (!require$$0.isValidElement(child)) {
329
+ const child = react.Children.toArray(children)[0];
330
+ if (!react.isValidElement(child)) {
331
331
  return null;
332
332
  }
333
333
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
334
- require$$0.cloneElement(child, {
334
+ react.cloneElement(child, {
335
335
  ref: styles_components_display_Divider_Divider_cjs.composeRefs(ref, child.ref),
336
336
  ["aria-describedby"]: open ? id : void 0
337
337
  }),