@blockbite/ui 2.0.7 → 2.0.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 (123) hide show
  1. package/dist/AutocompleteDropdown.d.ts +2 -1
  2. package/dist/AutocompleteDropdown.js +36 -94
  3. package/dist/AutocompleteDropdown.js.map +1 -0
  4. package/dist/Badge.d.ts +2 -1
  5. package/dist/Badge.js +6 -15
  6. package/dist/Badge.js.map +1 -0
  7. package/dist/BitePreview.d.ts +2 -1
  8. package/dist/BitePreview.js +54 -60
  9. package/dist/BitePreview.js.map +1 -0
  10. package/dist/Button.d.ts +2 -1
  11. package/dist/Button.js +12 -51
  12. package/dist/Button.js.map +1 -0
  13. package/dist/ButtonToggle.d.ts +1 -0
  14. package/dist/ButtonToggle.js +52 -111
  15. package/dist/ButtonToggle.js.map +1 -0
  16. package/dist/Chapter.d.ts +2 -1
  17. package/dist/Chapter.js +9 -18
  18. package/dist/Chapter.js.map +1 -0
  19. package/dist/ChapterDivider.d.ts +2 -1
  20. package/dist/ChapterDivider.js +10 -16
  21. package/dist/ChapterDivider.js.map +1 -0
  22. package/dist/Checkbox.d.ts +2 -1
  23. package/dist/Checkbox.js +13 -20
  24. package/dist/Checkbox.js.map +1 -0
  25. package/dist/DisappearingMessage.d.ts +2 -1
  26. package/dist/DisappearingMessage.js +28 -21
  27. package/dist/DisappearingMessage.js.map +1 -0
  28. package/dist/DropdownPicker.d.ts +2 -1
  29. package/dist/DropdownPicker.js +36 -52
  30. package/dist/DropdownPicker.js.map +1 -0
  31. package/dist/EmptyState.d.ts +2 -1
  32. package/dist/EmptyState.js +23 -17
  33. package/dist/EmptyState.js.map +1 -0
  34. package/dist/FloatingPanel.d.ts +2 -1
  35. package/dist/FloatingPanel.js +34 -41
  36. package/dist/FloatingPanel.js.map +1 -0
  37. package/dist/FocalPointControl.d.ts +1 -0
  38. package/dist/FocalPointControl.js +32 -40
  39. package/dist/FocalPointControl.js.map +1 -0
  40. package/dist/Icon.d.ts +2 -1
  41. package/dist/Icon.js +10 -8
  42. package/dist/Icon.js.map +1 -0
  43. package/dist/LinkPicker.d.ts +2 -1
  44. package/dist/LinkPicker.js +56 -65
  45. package/dist/LinkPicker.js.map +1 -0
  46. package/dist/MediaPicker.d.ts +2 -1
  47. package/dist/MediaPicker.js +103 -90
  48. package/dist/MediaPicker.js.map +1 -0
  49. package/dist/MetricsControl.d.ts +1 -0
  50. package/dist/MetricsControl.js +96 -117
  51. package/dist/MetricsControl.js.map +1 -0
  52. package/dist/Modal.d.ts +1 -0
  53. package/dist/Modal.js +81 -80
  54. package/dist/Modal.js.map +1 -0
  55. package/dist/NewWindowPortal.d.ts +2 -1
  56. package/dist/NewWindowPortal.js +54 -40
  57. package/dist/NewWindowPortal.js.map +1 -0
  58. package/dist/Notice.d.ts +2 -1
  59. package/dist/Notice.js +10 -23
  60. package/dist/Notice.js.map +1 -0
  61. package/dist/PasswordInput.d.ts +2 -1
  62. package/dist/PasswordInput.js +23 -36
  63. package/dist/PasswordInput.js.map +1 -0
  64. package/dist/Popover.d.ts +1 -0
  65. package/dist/Popover.js +28 -47
  66. package/dist/Popover.js.map +1 -0
  67. package/dist/RangeSlider.d.ts +1 -0
  68. package/dist/RangeSlider.js +41 -47
  69. package/dist/RangeSlider.js.map +1 -0
  70. package/dist/ResponsiveImage.d.ts +2 -1
  71. package/dist/ResponsiveImage.js +18 -36
  72. package/dist/ResponsiveImage.js.map +1 -0
  73. package/dist/ResponsiveVideo.d.ts +2 -1
  74. package/dist/ResponsiveVideo.js +9 -19
  75. package/dist/ResponsiveVideo.js.map +1 -0
  76. package/dist/ScrollList.d.ts +1 -0
  77. package/dist/ScrollList.js +10 -21
  78. package/dist/ScrollList.js.map +1 -0
  79. package/dist/SectionList.d.ts +2 -1
  80. package/dist/SectionList.js +67 -118
  81. package/dist/SectionList.js.map +1 -0
  82. package/dist/SelectControlWrapper.d.ts +2 -1
  83. package/dist/SelectControlWrapper.js +20 -32
  84. package/dist/SelectControlWrapper.js.map +1 -0
  85. package/dist/SingleBlockTypeAppender.d.ts +2 -1
  86. package/dist/SingleBlockTypeAppender.js +18 -18
  87. package/dist/SingleBlockTypeAppender.js.map +1 -0
  88. package/dist/SlideIn.d.ts +2 -1
  89. package/dist/SlideIn.js +17 -27
  90. package/dist/SlideIn.js.map +1 -0
  91. package/dist/Spinner.d.ts +2 -1
  92. package/dist/Spinner.js +17 -14
  93. package/dist/Spinner.js.map +1 -0
  94. package/dist/Tabs.d.ts +7 -6
  95. package/dist/Tabs.js +54 -50
  96. package/dist/Tabs.js.map +1 -0
  97. package/dist/Tag.d.ts +2 -1
  98. package/dist/Tag.js +7 -10
  99. package/dist/Tag.js.map +1 -0
  100. package/dist/TextControl.d.ts +2 -1
  101. package/dist/TextControl.js +22 -51
  102. package/dist/TextControl.js.map +1 -0
  103. package/dist/TextControlLabel.d.ts +2 -1
  104. package/dist/TextControlLabel.js +13 -18
  105. package/dist/TextControlLabel.js.map +1 -0
  106. package/dist/ToggleGroup.d.ts +1 -0
  107. package/dist/ToggleGroup.js +17 -51
  108. package/dist/ToggleGroup.js.map +1 -0
  109. package/dist/ToggleSwitch.d.ts +2 -1
  110. package/dist/ToggleSwitch.js +18 -28
  111. package/dist/ToggleSwitch.js.map +1 -0
  112. package/dist/Wrap.d.ts +2 -1
  113. package/dist/Wrap.js +9 -9
  114. package/dist/Wrap.js.map +1 -0
  115. package/dist/index.js +49 -88
  116. package/dist/index.js.map +1 -0
  117. package/dist/types.js +2 -0
  118. package/dist/types.js.map +1 -0
  119. package/package.json +24 -30
  120. package/dist/_virtual/jsx-runtime.js +0 -4
  121. package/dist/_virtual/react-jsx-runtime.development.js +0 -4
  122. package/dist/_virtual/react-jsx-runtime.production.min.js +0 -4
  123. package/dist/vite.svg +0 -1
package/dist/Chapter.js CHANGED
@@ -1,19 +1,10 @@
1
- import { j as e } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import r from "classnames";
3
- import { Wrap as s } from "./Wrap.js";
4
- const p = ({ children: t, title: m }) => /* @__PURE__ */ e.jsxs(
5
- s,
6
- {
7
- className: r(
8
- "text-gray-medium my-2 flex items-center gap-1 text-[12px] font-medium",
9
- r
10
- ),
11
- children: [
12
- m && /* @__PURE__ */ e.jsx(s, { className: "font-medium", children: m }),
13
- t
14
- ]
15
- }
16
- );
17
- export {
18
- p as Chapter
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ import { Wrap } from './Wrap.js';
4
+ void React;
5
+ export const Chapter = ({ children, title }) => {
6
+ return (React.createElement(Wrap, { className: classNames('text-gray-medium my-2 flex items-center gap-1 text-[12px] font-medium', classNames) },
7
+ title && React.createElement(Wrap, { className: "font-medium" }, title),
8
+ children));
19
9
  };
10
+ //# sourceMappingURL=Chapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chapter.js","sourceRoot":"","sources":["../src/Chapter.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAQX,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAgB,EAAE,EAAE;IAC3D,OAAO,CACL,oBAAC,IAAI,IACH,SAAS,EAAE,UAAU,CACnB,uEAAuE,EACvE,UAAU,CACX;QAEA,KAAK,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAC,aAAa,IAAE,KAAK,CAAQ;QACrD,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +1,9 @@
1
+ import React from 'react';
1
2
  type ChapterDividerProps = {
2
3
  id?: string;
3
4
  title?: string;
4
5
  className?: string;
5
6
  help?: string;
6
7
  };
7
- export declare const ChapterDivider: ({ id, title, className, help, }: ChapterDividerProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ChapterDivider: ({ id, title, className, help, }: ChapterDividerProps) => React.JSX.Element;
8
9
  export {};
@@ -1,17 +1,11 @@
1
- import { j as s } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import m from "classnames";
3
- const i = ({
4
- id: l = "",
5
- title: a,
6
- className: r,
7
- help: e
8
- }) => /* @__PURE__ */ s.jsxs("div", { ...l ? { id: l } : null, className: m("mb-4", r), children: [
9
- /* @__PURE__ */ s.jsxs("div", { className: "flex w-full flex-wrap items-center gap-2", children: [
10
- /* @__PURE__ */ s.jsx("small", { className: "shrink-1 text-[12px]", children: a }),
11
- /* @__PURE__ */ s.jsx("span", { className: "h-[1px] w-full bg-easy" })
12
- ] }),
13
- e && /* @__PURE__ */ s.jsx("small", { className: "w-full shrink-0 text-[12px]", children: e })
14
- ] });
15
- export {
16
- i as ChapterDivider
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ void React;
4
+ export const ChapterDivider = ({ id = '', title, className, help, }) => {
5
+ return (React.createElement("div", Object.assign({}, (id ? { id } : null), { className: classNames('mb-4', className) }),
6
+ React.createElement("div", { className: "flex w-full flex-wrap items-center gap-2" },
7
+ React.createElement("small", { className: "shrink-1 text-[12px]" }, title),
8
+ React.createElement("span", { className: "h-[1px] w-full bg-easy" })),
9
+ help && React.createElement("small", { className: "w-full shrink-0 text-[12px]" }, help)));
17
10
  };
11
+ //# sourceMappingURL=ChapterDivider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChapterDivider.js","sourceRoot":"","sources":["../src/ChapterDivider.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AASX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,EAAE,GAAG,EAAE,EACP,KAAK,EACL,SAAS,EACT,IAAI,GACgB,EAAE,EAAE;IACxB,OAAO,CACL,6CAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAE,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC;QACrE,6BAAK,SAAS,EAAC,0CAA0C;YACvD,+BAAO,SAAS,EAAC,sBAAsB,IAAE,KAAK,CAAS;YACvD,8BAAM,SAAS,EAAC,wBAAwB,GAAQ,CAC5C;QACL,IAAI,IAAI,+BAAO,SAAS,EAAC,6BAA6B,IAAE,IAAI,CAAS,CAClE,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  type CheckboxProps = {
2
3
  id: string;
3
4
  label?: string;
@@ -5,5 +6,5 @@ type CheckboxProps = {
5
6
  defaultChecked?: boolean;
6
7
  onCheckedChange: (checked: boolean, id: string) => void;
7
8
  };
8
- export declare const Checkbox: ({ label, help, defaultChecked }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Checkbox: ({ label, help, defaultChecked }: CheckboxProps) => React.JSX.Element;
9
10
  export {};
package/dist/Checkbox.js CHANGED
@@ -1,21 +1,14 @@
1
- import { j as r } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import { CheckboxControl as m } from "@wordpress/components";
3
- import { useState as i, useEffect as x } from "@wordpress/element";
4
- import { Wrap as n } from "./Wrap.js";
5
- const f = ({ label: t, help: s, defaultChecked: e }) => {
6
- const [c, o] = i(e);
7
- return x(() => {
8
- o(e);
9
- }, [e]), /* @__PURE__ */ r.jsx(n, { className: "blockbite-ui__checkbox mx-1 flex items-center gap-2", children: /* @__PURE__ */ r.jsx(
10
- m,
11
- {
12
- label: t,
13
- help: s,
14
- checked: c,
15
- onChange: o
16
- }
17
- ) });
18
- };
19
- export {
20
- f as Checkbox
1
+ import { CheckboxControl } from '@wordpress/components';
2
+ import { useEffect, useState } from '@wordpress/element';
3
+ import React from 'react';
4
+ import { Wrap } from './Wrap.js';
5
+ void React;
6
+ export const Checkbox = ({ label, help, defaultChecked }) => {
7
+ const [isChecked, setChecked] = useState(defaultChecked);
8
+ useEffect(() => {
9
+ setChecked(defaultChecked);
10
+ }, [defaultChecked]);
11
+ return (React.createElement(Wrap, { className: "blockbite-ui__checkbox mx-1 flex items-center gap-2" },
12
+ React.createElement(CheckboxControl, { label: label, help: help, checked: isChecked, onChange: setChecked })));
21
13
  };
14
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAUX,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAiB,EAAE,EAAE;IACzE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,cAAc,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS,EAAC,qDAAqD;QACnE,oBAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,UAAU,GACpB,CACG,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  type DisappearingMessageProps = {
2
3
  duration: number;
3
4
  children: React.ReactNode;
4
5
  trigger: boolean;
5
6
  };
6
- export declare const DisappearingMessage: ({ duration, children, trigger, }: DisappearingMessageProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const DisappearingMessage: ({ duration, children, trigger, }: DisappearingMessageProps) => React.JSX.Element;
7
8
  export {};
@@ -1,22 +1,29 @@
1
- import { j as n } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import { useState as l, useRef as i, useEffect as o } from "@wordpress/element";
3
- const p = ({
4
- duration: t,
5
- children: a,
6
- trigger: s
7
- }) => {
8
- const [f, r] = l(!1), e = i(!1);
9
- return o(() => {
10
- e.current = !0;
11
- }, []), o(() => {
12
- let u = null;
13
- return s && !e.current ? (r(!0), u = setTimeout(() => {
14
- r(!1);
15
- }, t)) : e.current = !1, () => {
16
- clearTimeout(u);
17
- };
18
- }, [s, t]), f && /* @__PURE__ */ n.jsx(n.Fragment, { children: a });
19
- };
20
- export {
21
- p as DisappearingMessage
1
+ import { useEffect, useRef, useState } from '@wordpress/element';
2
+ import React from 'react';
3
+ void React;
4
+ export const DisappearingMessage = ({ duration, children, trigger, }) => {
5
+ const [alert, setAlert] = useState(false);
6
+ const isMountingRef = useRef(false);
7
+ useEffect(() => {
8
+ isMountingRef.current = true;
9
+ }, []);
10
+ useEffect(() => {
11
+ let timeoutId = null;
12
+ // Only run on subsequent renders
13
+ if (trigger && !isMountingRef.current) {
14
+ setAlert(true);
15
+ timeoutId = setTimeout(() => {
16
+ setAlert(false);
17
+ }, duration);
18
+ }
19
+ else {
20
+ isMountingRef.current = false;
21
+ }
22
+ // Cleanup timeout on unmount or when `trigger` changes
23
+ return () => {
24
+ clearTimeout(timeoutId);
25
+ };
26
+ }, [trigger, duration]);
27
+ return alert && React.createElement(React.Fragment, null, children);
22
28
  };
29
+ //# sourceMappingURL=DisappearingMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisappearingMessage.js","sourceRoot":"","sources":["../src/DisappearingMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAQX,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,OAAO,GACkB,EAAE,EAAE;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,iCAAiC;QACjC,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC1B,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,EAAE,QAAQ,CAAC,CAAC;QACf,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QAChC,CAAC;QAED,uDAAuD;QACvD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExB,OAAO,KAAK,IAAI,0CAAG,QAAQ,CAAI,CAAC;AAClC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  type DropdownPickerProps = {
2
3
  label?: string;
3
4
  className?: string;
@@ -11,5 +12,5 @@ type DropdownPickerProps = {
11
12
  }[];
12
13
  onPressedChange: (value: string | null) => void;
13
14
  };
14
- export declare const DropdownPicker: ({ label, className, defaultValue, defaultIcon, onPressedChange, options, }: DropdownPickerProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const DropdownPicker: ({ label, className, defaultValue, defaultIcon, onPressedChange, options, }: DropdownPickerProps) => React.JSX.Element;
15
16
  export {};
@@ -1,53 +1,37 @@
1
- import { j as o } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import { ChevronDown as p } from "@blockbite/icons";
3
- import { DropdownMenu as b } from "@wordpress/components";
4
- import { useState as f, useEffect as v } from "@wordpress/element";
5
- import x from "classnames";
6
- import { Icon as n } from "./Icon.js";
7
- const O = ({
8
- label: s,
9
- className: m,
10
- defaultValue: t,
11
- defaultIcon: l = p,
12
- onPressedChange: c,
13
- options: i
14
- }) => {
15
- const [a, r] = f(null);
16
- v(() => {
17
- r(t);
18
- }, [t]);
19
- const u = [
20
- ...i.map((e) => ({
21
- icon: e.icon,
22
- label: e.label,
23
- title: e.label,
24
- value: e.value,
25
- onClick: () => {
26
- r(e.value), c(e.value);
27
- }
28
- })),
29
- {
30
- icon: /* @__PURE__ */ o.jsx(n, { icon: l }),
31
- title: "Reset",
32
- value: "reset",
33
- onClick: () => {
34
- r("reset"), c("reset");
35
- }
36
- }
37
- ];
38
- return /* @__PURE__ */ o.jsx(
39
- b,
40
- {
41
- controls: u,
42
- className: x(
43
- "blockbite-ui__dropdown-picker border-primary border",
44
- m
45
- ),
46
- icon: i.find((e) => e.value === a)?.icon || /* @__PURE__ */ o.jsx(n, { icon: l }),
47
- label: s || "Select"
48
- }
49
- );
50
- };
51
- export {
52
- O as DropdownPicker
1
+ import { ChevronDown as ChevronDownIcon } from '@blockbite/icons';
2
+ import { DropdownMenu } from '@wordpress/components';
3
+ import { useEffect, useState } from '@wordpress/element';
4
+ import classNames from 'classnames';
5
+ import React from 'react';
6
+ import { Icon } from './Icon.js';
7
+ void React;
8
+ export const DropdownPicker = ({ label, className, defaultValue, defaultIcon = ChevronDownIcon, onPressedChange, options, }) => {
9
+ var _a;
10
+ const [currentOption, setCurrentOption] = useState(null);
11
+ useEffect(() => {
12
+ setCurrentOption(defaultValue);
13
+ }, [defaultValue]);
14
+ const allOptions = [
15
+ ...options.map((option) => ({
16
+ icon: option.icon,
17
+ label: option.label,
18
+ title: option.label,
19
+ value: option.value,
20
+ onClick: () => {
21
+ setCurrentOption(option.value);
22
+ onPressedChange(option.value);
23
+ },
24
+ })),
25
+ {
26
+ icon: React.createElement(Icon, { icon: defaultIcon }),
27
+ title: 'Reset',
28
+ value: 'reset',
29
+ onClick: () => {
30
+ setCurrentOption('reset');
31
+ onPressedChange('reset');
32
+ },
33
+ },
34
+ ];
35
+ return (React.createElement(DropdownMenu, { controls: allOptions, className: classNames('blockbite-ui__dropdown-picker border-primary border', className), icon: ((_a = options.find((option) => option.value === currentOption)) === null || _a === void 0 ? void 0 : _a.icon) || (React.createElement(Icon, { icon: defaultIcon })), label: label || 'Select' }));
53
36
  };
37
+ //# sourceMappingURL=DropdownPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownPicker.js","sourceRoot":"","sources":["../src/DropdownPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAgBX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,GAAG,eAAe,EAC7B,eAAe,EACf,OAAO,GACa,EAAE,EAAE;;IACxB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,UAAU,GAAG;QACjB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC1B,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,GAAG,EAAE;gBACZ,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC/B,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;SACF,CAAC,CAAC;QACH;YACE,IAAI,EAAE,oBAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI;YACjC,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,GAAG,EAAE;gBACZ,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAC1B,eAAe,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,YAAY,IACX,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,UAAU,CACnB,qDAAqD,EACrD,SAAS,CACV,EACD,IAAI,EACF,CAAA,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC,0CAAE,IAAI,KAAI,CAChE,oBAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI,CAC5B,EAEH,KAAK,EAAE,KAAK,IAAI,QAAQ,GACxB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  type Props = {
2
3
  icon?: JSX.Element;
3
4
  title: string;
@@ -5,5 +6,5 @@ type Props = {
5
6
  children?: React.ReactNode;
6
7
  [key: string]: any;
7
8
  };
8
- export declare function EmptyState({ icon, title, description, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export declare function EmptyState({ icon, title, description, children, ...rest }: Props): React.JSX.Element;
9
10
  export {};
@@ -1,18 +1,24 @@
1
- import { j as s } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- function n({
3
- icon: t,
4
- title: m,
5
- description: a,
6
- children: e = null,
7
- ...l
8
- }) {
9
- return /* @__PURE__ */ s.jsx("div", { ...l, children: /* @__PURE__ */ s.jsx("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans", children: /* @__PURE__ */ s.jsxs("div", { className: "max-w-sm", children: [
10
- t && /* @__PURE__ */ s.jsx("div", { className: "mx-auto !text-gray-400", children: t }),
11
- /* @__PURE__ */ s.jsx("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium", children: m }),
12
- /* @__PURE__ */ s.jsx("p", { className: "mt-1 !font-sans text-sm !text-gray-500", children: a }),
13
- e && /* @__PURE__ */ s.jsx("div", { className: "mt-4", children: e })
14
- ] }) }) });
15
- }
16
- export {
17
- n as EmptyState
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
18
11
  };
12
+ import React from 'react';
13
+ void React;
14
+ export function EmptyState(_a) {
15
+ var { icon, title, description, children = null } = _a, rest = __rest(_a, ["icon", "title", "description", "children"]);
16
+ return (React.createElement("div", Object.assign({}, rest),
17
+ React.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans" },
18
+ React.createElement("div", { className: "max-w-sm" },
19
+ icon && React.createElement("div", { className: "mx-auto !text-gray-400" }, icon),
20
+ React.createElement("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium" }, title),
21
+ React.createElement("p", { className: "mt-1 !font-sans text-sm !text-gray-500" }, description),
22
+ children && React.createElement("div", { className: "mt-4" }, children)))));
23
+ }
24
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AASX,MAAM,UAAU,UAAU,CAAC,EAMnB;QANmB,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,IAAI,OAET,EADH,IAAI,cALkB,4CAM1B,CADQ;IAEP,OAAO,CACL,6CAAS,IAAI;QACX,6BAAK,SAAS,EAAC,gFAAgF;YAC7F,6BAAK,SAAS,EAAC,UAAU;gBACtB,IAAI,IAAI,6BAAK,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAO;gBAC7D,4BAAI,SAAS,EAAC,sDAAsD,IACjE,KAAK,CACH;gBACL,2BAAG,SAAS,EAAC,wCAAwC,IAClD,WAAW,CACV;gBACH,QAAQ,IAAI,6BAAK,SAAS,EAAC,MAAM,IAAE,QAAQ,CAAO,CAC/C,CACF,CACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  type DraggablePanelProps = {
2
3
  children: React.ReactNode;
3
4
  };
4
5
  export declare function FloatingPanel({ children, }: DraggablePanelProps & {
5
6
  children: React.ReactNode;
6
- }): import("react/jsx-runtime").JSX.Element;
7
+ }): React.JSX.Element;
7
8
  export {};
@@ -1,43 +1,36 @@
1
- import { j as o } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import { useRef as x, useState as s, useEffect as g } from "@wordpress/element";
3
- function w({
4
- children: c
5
- }) {
6
- const i = x(null), [r, d] = s({ x: 100, y: 100 }), [l, a] = s(!1), [n, f] = s({ x: 0, y: 0 });
7
- g(() => {
8
- const e = (u) => {
9
- l && d({
10
- x: u.clientX - n.x,
11
- y: u.clientY - n.y
12
- });
13
- }, t = () => a(!1);
14
- return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), () => {
15
- window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
1
+ import { useEffect, useRef, useState } from '@wordpress/element';
2
+ import React from 'react';
3
+ void React;
4
+ export function FloatingPanel({ children, }) {
5
+ const panelRef = useRef(null);
6
+ const [position, setPosition] = useState({ x: 100, y: 100 });
7
+ const [dragging, setDragging] = useState(false);
8
+ const [offset, setOffset] = useState({ x: 0, y: 0 });
9
+ useEffect(() => {
10
+ const handleMouseMove = (e) => {
11
+ if (dragging) {
12
+ setPosition({
13
+ x: e.clientX - offset.x,
14
+ y: e.clientY - offset.y,
15
+ });
16
+ }
17
+ };
18
+ const handleMouseUp = () => setDragging(false);
19
+ window.addEventListener('mousemove', handleMouseMove);
20
+ window.addEventListener('mouseup', handleMouseUp);
21
+ return () => {
22
+ window.removeEventListener('mousemove', handleMouseMove);
23
+ window.removeEventListener('mouseup', handleMouseUp);
24
+ };
25
+ }, [dragging, offset]);
26
+ const startDragging = (e) => {
27
+ const rect = panelRef.current.getBoundingClientRect();
28
+ setOffset({ x: e.clientX - rect.left, y: e.clientY - rect.top });
29
+ setDragging(true);
16
30
  };
17
- }, [l, n]);
18
- const m = (e) => {
19
- const t = i.current.getBoundingClientRect();
20
- f({ x: e.clientX - t.left, y: e.clientY - t.top }), a(!0);
21
- };
22
- return /* @__PURE__ */ o.jsx("div", { className: "bb_", children: /* @__PURE__ */ o.jsxs(
23
- "div",
24
- {
25
- ref: i,
26
- className: "fixed bg-white shadow-xl rounded-2xl p-4 w-[400px] h-[550px] z-[9999]",
27
- style: { left: r.x, top: r.y },
28
- children: [
29
- c,
30
- /* @__PURE__ */ o.jsx(
31
- "div",
32
- {
33
- className: "absolute top-1 right-1 cursor-move w-5 h-5 bg-gray-300 rounded",
34
- onMouseDown: m
35
- }
36
- )
37
- ]
38
- }
39
- ) });
31
+ return (React.createElement("div", { className: "bb_" },
32
+ React.createElement("div", { ref: panelRef, className: "fixed bg-white shadow-xl rounded-2xl p-4 w-[400px] h-[550px] z-[9999]", style: { left: position.x, top: position.y } },
33
+ children,
34
+ React.createElement("div", { className: "absolute top-1 right-1 cursor-move w-5 h-5 bg-gray-300 rounded", onMouseDown: startDragging }))));
40
35
  }
41
- export {
42
- w as FloatingPanel
43
- };
36
+ //# sourceMappingURL=FloatingPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloatingPanel.js","sourceRoot":"","sources":["../src/FloatingPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,KAAK,KAAK,CAAC;AAMX,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,GAGT;IACC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7D,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAErD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE;YAC5B,IAAI,QAAQ,EAAE,CAAC;gBACb,WAAW,CAAC;oBACV,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;oBACvB,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;iBACxB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE/C,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAElD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YACzD,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvB,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QACtD,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACjE,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,KAAK;QAClB,6BACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAC,uEAAuE,EACjF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE;YAE3C,QAAQ;YACT,6BACE,SAAS,EAAC,gEAAgE,EAC1E,WAAW,EAAE,aAAa,GACrB,CACH,CACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  type FocalPointControlProps = {
2
3
  defaultValue: string;
3
4
  onValueChange: (value: string) => void;
@@ -1,41 +1,33 @@
1
- import { j as i } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import { FocalPointPicker as p } from "@wordpress/components";
3
- import { useState as x, useEffect as s } from "@wordpress/element";
4
- import { Wrap as m } from "./Wrap.js";
5
- const d = ({
6
- defaultValue: e,
7
- onValueChange: a,
8
- url: c
9
- }) => {
10
- const [t, r] = x({
11
- x: 0.5,
12
- y: 0.5
13
- });
14
- return s(() => {
15
- a(
16
- `[${(t.x * 100).toFixed(2)}%_${(t.y * 100).toFixed(
17
- 2
18
- )}%]`
19
- );
20
- }, [t]), s(() => {
21
- if (e.includes("%")) {
22
- const [o, n] = e.replace("[", "").replace("%]", "").split("_").map((l) => parseFloat(l) / 100);
23
- r({
24
- x: o,
25
- y: n
26
- });
27
- }
28
- }, [e]), /* @__PURE__ */ i.jsx(m, { className: "relative flex flex-col", children: /* @__PURE__ */ i.jsx(
29
- p,
30
- {
31
- url: c,
32
- value: t,
33
- onDrag: (o) => r(o),
34
- onChange: (o) => r(o)
35
- }
36
- ) });
37
- };
38
- export {
39
- d as FocalPointControl,
40
- d as default
1
+ import { FocalPointPicker } from '@wordpress/components';
2
+ import { useEffect, useState } from '@wordpress/element';
3
+ import React from 'react';
4
+ import { Wrap } from './Wrap.js';
5
+ void React;
6
+ export const FocalPointControl = ({ defaultValue, onValueChange, url, }) => {
7
+ const [focalPoint, setFocalPoint] = useState({
8
+ x: 0.5,
9
+ y: 0.5,
10
+ });
11
+ useEffect(() => {
12
+ onValueChange(`[${(focalPoint.x * 100).toFixed(2)}%_${(focalPoint.y * 100).toFixed(2)}%]`);
13
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14
+ }, [focalPoint]);
15
+ useEffect(() => {
16
+ // default value is in the format of [x%_y%] parse to get the x and y values
17
+ if (defaultValue.includes('%')) {
18
+ const [x, y] = defaultValue
19
+ .replace('[', '')
20
+ .replace('%]', '')
21
+ .split('_')
22
+ .map((value) => parseFloat(value) / 100);
23
+ setFocalPoint({
24
+ x,
25
+ y,
26
+ });
27
+ }
28
+ }, [defaultValue]);
29
+ return (React.createElement(Wrap, { className: "relative flex flex-col" },
30
+ React.createElement(FocalPointPicker, { url: url, value: focalPoint, onDrag: (value) => setFocalPoint(value), onChange: (value) => setFocalPoint(value) })));
41
31
  };
32
+ export default FocalPointControl;
33
+ //# sourceMappingURL=FocalPointControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FocalPointControl.js","sourceRoot":"","sources":["../src/FocalPointControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAQX,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,YAAY,EACZ,aAAa,EACb,GAAG,GACJ,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC;QAC3C,CAAC,EAAE,GAAG;QACN,CAAC,EAAE,GAAG;KACP,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CACX,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAClE,CAAC,CACF,IAAI,CACN,CAAC;QACF,uDAAuD;IACzD,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,SAAS,CAAC,GAAG,EAAE;QACb,4EAA4E;QAC5E,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY;iBACxB,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;iBAChB,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;iBACjB,KAAK,CAAC,GAAG,CAAC;iBACV,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;YAEnD,aAAa,CAAC;gBACZ,CAAC;gBACD,CAAC;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS,EAAC,wBAAwB;QACtC,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACzC,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
package/dist/Icon.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  type IconProps = {
2
3
  icon: React.FC<React.SVGProps<SVGSVGElement>> | null;
3
4
  className?: string;
4
5
  };
5
- export declare const Icon: ({ icon: IconComponent, className }: IconProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Icon: ({ icon: IconComponent, className }: IconProps) => React.JSX.Element;
6
7
  export {};
package/dist/Icon.js CHANGED
@@ -1,9 +1,11 @@
1
- import { j as s } from "./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js";
2
- import { Wrap as o } from "./Wrap.js";
3
- const e = ({ icon: r, className: i = "" }) => r ? /* @__PURE__ */ s.jsxs(o, { className: "blockbite--icon", children: [
4
- /* @__PURE__ */ s.jsx(r, { className: i }),
5
- " "
6
- ] }) : null;
7
- export {
8
- e as Icon
1
+ import React from 'react';
2
+ import { Wrap } from './Wrap.js';
3
+ void React;
4
+ export const Icon = ({ icon: IconComponent, className = '' }) => {
5
+ if (!IconComponent)
6
+ return null;
7
+ return (React.createElement(Wrap, { className: `blockbite--icon` },
8
+ React.createElement(IconComponent, { className: className }),
9
+ ' '));
9
10
  };
11
+ //# sourceMappingURL=Icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,KAAK,KAAK,CAAC;AAOX,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,GAAG,EAAE,EAAa,EAAE,EAAE;IACzE,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS,EAAE,iBAAiB;QAChC,oBAAC,aAAa,IAAC,SAAS,EAAE,SAAS,GAAI;QAAC,GAAG,CAEtC,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1,2 @@
1
- export declare function LinkPicker(props: any): import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ export declare function LinkPicker(props: any): React.JSX.Element;