@berenjena/react-dev-panel 0.0.1-beta.4 → 0.0.1-beta.6

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 (42) hide show
  1. package/dist/assets/BooleanControl.css +1 -1
  2. package/dist/assets/ButtonControl.css +1 -1
  3. package/dist/assets/ButtonGroupControl.css +1 -0
  4. package/dist/assets/ColorControl.css +1 -1
  5. package/dist/assets/DevPanel.css +1 -1
  6. package/dist/assets/Input.css +1 -0
  7. package/dist/assets/Section.css +1 -1
  8. package/dist/assets/Select.css +1 -0
  9. package/dist/assets/index.css +1 -1
  10. package/dist/components/ControlRenderer/controls/BooleanControl/BooleanControl.js +14 -13
  11. package/dist/components/ControlRenderer/controls/ButtonControl/ButtonControl.js +4 -4
  12. package/dist/components/ControlRenderer/controls/ButtonGroupControl/ButtonGroupControl.d.ts +2 -0
  13. package/dist/components/ControlRenderer/controls/ButtonGroupControl/ButtonGroupControl.js +22 -0
  14. package/dist/components/ControlRenderer/controls/ButtonGroupControl/index.d.ts +1 -0
  15. package/dist/components/ControlRenderer/controls/ButtonGroupControl/index.js +4 -0
  16. package/dist/components/ControlRenderer/controls/ButtonGroupControl/types.d.ts +14 -0
  17. package/dist/components/ControlRenderer/controls/ColorControl/ColorControl.js +19 -15
  18. package/dist/components/ControlRenderer/controls/NumberControl/NumberControl.d.ts +15 -1
  19. package/dist/components/ControlRenderer/controls/NumberControl/NumberControl.js +21 -11
  20. package/dist/components/ControlRenderer/controls/NumberControl/types.d.ts +2 -2
  21. package/dist/components/ControlRenderer/controls/SelectControl/SelectControl.js +9 -8
  22. package/dist/components/ControlRenderer/controls/TextControl/TextControl.d.ts +13 -1
  23. package/dist/components/ControlRenderer/controls/TextControl/TextControl.js +23 -13
  24. package/dist/components/ControlRenderer/controls/TextControl/types.d.ts +2 -3
  25. package/dist/components/ControlRenderer/controls/index.d.ts +1 -0
  26. package/dist/components/ControlRenderer/controls/index.js +30 -26
  27. package/dist/components/ControlRenderer/controls/types.d.ts +7 -0
  28. package/dist/components/DevPanel/DevPanel.js +27 -36
  29. package/dist/components/Input/Input.d.ts +1 -0
  30. package/dist/components/Input/Input.js +10 -0
  31. package/dist/components/Input/index.d.ts +1 -0
  32. package/dist/components/Input/index.js +4 -0
  33. package/dist/components/Section/Section.js +5 -5
  34. package/dist/components/Select/Select.d.ts +1 -0
  35. package/dist/components/Select/Select.js +10 -0
  36. package/dist/components/Select/index.d.ts +1 -0
  37. package/dist/components/Select/index.js +4 -0
  38. package/package.json +3 -3
  39. package/dist/assets/NumberControl.css +0 -1
  40. package/dist/assets/TextControl.css +0 -1
  41. package/dist/hooks/useHotkeys/example.d.ts +0 -5
  42. package/dist/hooks/useHotkeys/example.js +0 -266
@@ -1 +1 @@
1
- ._checkboxLabel_1m9o5_1{display:inline-flex;align-items:center;cursor:pointer;position:relative}._checkbox_1m9o5_1{opacity:0;position:absolute;width:0;height:0}._checkboxCustom_1m9o5_15{width:18px;height:18px;border:2px solid #ddd;border-radius:3px;background-color:#fff;display:inline-block;position:relative;transition:all .2s ease}._checkboxCustom_1m9o5_15:after{content:"";position:absolute;display:none;left:4px;top:1px;width:6px;height:10px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}._checkbox_1m9o5_1:checked+._checkboxCustom_1m9o5_15{background-color:#4caf50;border-color:#4caf50}._checkbox_1m9o5_1:checked+._checkboxCustom_1m9o5_15:after{display:block}._checkbox_1m9o5_1:disabled+._checkboxCustom_1m9o5_15{background-color:#f5f5f5;cursor:not-allowed}
1
+ ._switch_1i71a_1{--width: 42px;--height: 20px;--thumb-size: 12px;--thumb-offset: 3px;--thumb-checked-offset: calc(var(--width) - var(--thumb-size) - calc(var(--thumb-offset) * 2) - calc(var(--thumb-offset) / 2));--track-background: var(--dev-panel-input-background-color);--track-border: color-mix(in srgb, var(--dev-panel-border-color) 50%, transparent);--thumb-background: var(--dev-panel-text-color);--thumb-checked-background: white;--focus-ring-color: var(--dev-panel-accent-color);position:relative;display:inline-block;width:var(--width);height:var(--height)}._switch_1i71a_1 input{position:absolute;opacity:0;width:0;height:0;margin:0;pointer-events:none}._switch_1i71a_1 input:checked+._slider_1i71a_25{background-color:var(--focus-ring-color)}._switch_1i71a_1 input:checked+._slider_1i71a_25:before{transform:translate(var(--thumb-checked-offset));background-color:var(--thumb-checked-background)}._switch_1i71a_1 input:focus+._slider_1i71a_25{box-shadow:none;outline:none}._switch_1i71a_1 input:disabled+._slider_1i71a_25{opacity:.5;cursor:not-allowed}._switch_1i71a_1 input:disabled+._slider_1i71a_25:before{opacity:.7}._switch_1i71a_1 ._slider_1i71a_25{position:absolute;inset:0;background-color:var(--dev-panel-input-background-color);border:1px solid color-mix(in srgb,var(--dev-panel-border-color) 20%,transparent);border-radius:var(--dev-panel-border-radius);cursor:pointer;transition:var(--dev-panel-transition)}._switch_1i71a_1 ._slider_1i71a_25:before{content:"";position:absolute;top:var(--thumb-offset);left:var(--thumb-offset);width:var(--thumb-size);height:var(--thumb-size);background-color:var(--thumb-background);border-radius:calc(var(--dev-panel-border-radius) - 2px);transition:var(--dev-panel-transition);transform:scale(.95)}._switch_1i71a_1 ._slider_1i71a_25:hover{border-color:var(--dev-panel-accent-color)}._switch_1i71a_1 ._slider_1i71a_25:hover:before{box-shadow:0 2px 6px #00000026}
@@ -1 +1 @@
1
- ._button_vlxsf_1{width:100%;padding:8px 16px;border:none;border-radius:4px;font-size:14px;font-weight:500;background-color:#4caf50;color:#fff;cursor:pointer;transition:background-color .2s ease}._button_vlxsf_1:hover:not(:disabled){background-color:#45a049}._button_vlxsf_1:active:not(:disabled){background-color:#3e8e41}._button_vlxsf_1:disabled{background-color:#ccc;cursor:not-allowed}
1
+ ._button_e2m3l_1{width:100%;padding:var(--dev-panel-spacing-xs) var(--dev-panel-spacing-sm);height:var(--dev-panel-inputs-height);border:none;border-radius:4px;font-size:11px;font-weight:500;background-color:var(--dev-panel-accent-color);color:var(--dev-panel-text-color-highlight);cursor:pointer;transition:var(--dev-panel-transition)}._button_e2m3l_1:hover:not(:disabled){background-color:color-mix(in srgb,var(--dev-panel-accent-color) 80%,transparent)}._button_e2m3l_1:disabled{background-color:color-mix(in srgb,var(--dev-panel-accent-color) 20%,var(--dev-panel-background-color));cursor:not-allowed}
@@ -0,0 +1 @@
1
+ ._buttonGroupContainer_99d3t_1{width:100%;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;gap:1px}._buttonGroupContainer_99d3t_1 button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}._buttonGroupContainer_99d3t_1 button:not(:last-child):not(:first-child){border-radius:0}._buttonGroupContainer_99d3t_1 button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}
@@ -1 +1 @@
1
- ._colorInput_5ww2_1{width:100%;height:40px;border:1px solid #ddd;border-radius:4px;cursor:pointer;padding:0}._colorInput_5ww2_1:focus{outline:none;border-color:#4caf50;box-shadow:0 0 0 2px #4caf5033}._colorInput_5ww2_1:disabled{cursor:not-allowed;opacity:.6}
1
+ ._container_ds1no_1{display:grid;grid-template-columns:var(--dev-panel-inputs-height) 1fr;gap:8px}._container_ds1no_1 label{overflow:hidden;width:auto;height:var(--dev-panel-inputs-height);cursor:pointer;border-radius:var(--dev-panel-border-radius)}._container_ds1no_1 input[type=color]{background:none;border:0;width:150%;height:150%;margin:-25%}._container_ds1no_1 input[type=color]:focus{border-radius:0;outline:none}
@@ -1 +1 @@
1
- :root{--dev-panel-font-family: Helvetica, Arial, Sans-Serif;--dev-panel-primary-color: #0070f3;--dev-panel-secondary-color: #1c1c1c;--dev-panel-background-color: #f8f9fa;--dev-panel-border-color: #e9ecef;--dev-panel-text-color: #333;--dev-panel-shadow: 0 8px 24px rgba(0, 0, 0, .2);--dev-panel-max-width: 320px;--dev-panel-max-height: 80vh}@media (prefers-color-scheme: dark){:root{--dev-panel-background-color: #2a2a2a;--dev-panel-border-color: #555;--dev-panel-text-color: #e0e0e0;--dev-panel-shadow: 0 8px 24px rgba(0, 0, 0, .5)}}._devPanelContainer_k5g13_21{position:fixed;z-index:9998;border:1px solid #ccc;border-radius:8px;box-shadow:0 8px 24px #0003;width:var(--dev-panel-max-width);max-height:var(--dev-panel-max-height);overflow:hidden;-webkit-user-select:none;user-select:none;font-family:var(--dev-panel-font-family)}._header_k5g13_34{display:flex;align-items:center;justify-content:space-between;padding:4px;background:#1e2233;border-bottom:1px solid #e9ecef;cursor:move}._header_k5g13_34:hover{background:#e9ecef}._title_k5g13_47{font-size:12px;font-weight:600;color:#333;display:flex;align-items:center;gap:8px}._headerButton_k5g13_56{background:none;border:none;color:#666;font-size:12px;cursor:pointer;padding:4px 8px;border-radius:4px;transition:all .2s ease}._headerButton_k5g13_56:hover{background:#dee2e6;color:#333}._headerButton_k5g13_56:active{transform:scale(.95)}._content_k5g13_74{max-height:calc(80vh - 48px);overflow-y:auto}._actions_k5g13_79{display:flex;justify-content:center;padding-top:12px;margin-top:12px;border-top:1px solid #e9ecef}._actions_k5g13_79:last-child{border:none}._resetButton_k5g13_90{background:#dc3545;color:#fff;border:none;padding:6px 12px;border-radius:4px;font-size:12px;cursor:pointer;transition:background .2s ease}._resetButton_k5g13_90:hover{background:#c82333}._resetButton_k5g13_90:active{background:#bd2130}._content_k5g13_74::-webkit-scrollbar{width:6px}._content_k5g13_74::-webkit-scrollbar-track{background:#f1f1f1}._content_k5g13_74::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}._content_k5g13_74::-webkit-scrollbar-thumb:hover{background:#a8a8a8}@media (prefers-color-scheme: dark){._devPanelContainer_k5g13_21{background:#2a2a2a;border-color:#555}._header_k5g13_34{background:#1e2233;border-color:#555}._header_k5g13_34:hover{background:#444}._title_k5g13_47{color:#e0e0e0}._headerButton_k5g13_56{color:#b0b0b0}._headerButton_k5g13_56:hover{background:#555;color:#e0e0e0}._actions_k5g13_79{border-color:#555}._resetButton_k5g13_90{background:#dc3545}._resetButton_k5g13_90:hover{background:#c82333}._content_k5g13_74::-webkit-scrollbar-track{background:#333}._content_k5g13_74::-webkit-scrollbar-thumb{background:#666}._content_k5g13_74::-webkit-scrollbar-thumb:hover{background:#777}}._dragging_k5g13_168{opacity:.9;cursor:grabbing!important;transition:opacity .2s ease}
1
+ :root{--dev-panel-font-family: Helvetica, Arial, Sans-Serif;--dev-panel-font-size-xs: 12px;--dev-panel-font-size-sm: 14px;--dev-panel-font-size-md: 16px;--dev-panel-font-size-lg: 18px;--dev-panel-accent-color: #6663fd;--dev-panel-primary-color: #6663fd;--dev-panel-secondary-color: #1c1c1c;--dev-panel-background-color: #3e3d40;--dev-panel-highlight-color: #f0f0f0;--dev-panel-foreground-color: #313133;--dev-panel-border-color: #a1a1a1;--dev-panel-text-color: #e0e0e0;--dev-panel-text-color-muted: #b0b0b0;--dev-panel-input-background-color: #302f32;--dev-panel-text-color-highlight: #fbfffa;--dev-panel-spacing-xs: 4px;--dev-panel-spacing-sm: 8px;--dev-panel-spacing-md: 10px;--dev-panel-spacing-lg: 14px;--dev-panel-shadow: 0 8px 24px rgba(0, 0, 0, .2);--dev-panel-max-width: 320px;--dev-panel-max-height: 80vh;--dev-panel-inputs-height: 24px;--dev-panel-border-radius: 6px;--dev-panel-transition: all .2s cubic-bezier(.4, 0, .2, 1)}._devPanelContainer_12zm6_30{position:fixed;z-index:9998;border-radius:var(--dev-panel-border-radius);box-shadow:0 8px 24px #0003;width:var(--dev-panel-max-width);max-height:var(--dev-panel-max-height);overflow:hidden;-webkit-user-select:none;user-select:none;font-family:var(--dev-panel-font-family)}._devPanelContainer_12zm6_30 ._header_12zm6_41{display:flex;align-items:center;justify-content:space-between;padding:var(--dev-panel-spacing-xs);background:var(--dev-panel-foreground-color);cursor:move;color:var(--dev-panel-text-color)}._devPanelContainer_12zm6_30 ._title_12zm6_50{font-size:var(--dev-panel-font-size-xs);font-weight:600;display:flex;align-items:center;gap:var(--dev-panel-spacing-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._devPanelContainer_12zm6_30 ._button_12zm6_60{background:none;border:none;color:inherit;font-size:var(--dev-panel-font-size-sm);cursor:pointer;padding:var(--dev-panel-spacing-xs) var(--dev-panel-spacing-sm);border-radius:4px;transition:all .2s ease}._devPanelContainer_12zm6_30 ._button_12zm6_60:hover{background:#dee2e6;color:#333}._devPanelContainer_12zm6_30 ._button_12zm6_60:active{transform:scale(.95)}._content_12zm6_78{max-height:calc(var(--dev-panel-max-height) - 48px);overflow-y:auto;background-color:var(--dev-panel-background-color)}._content_12zm6_78::-webkit-scrollbar{width:6px}._content_12zm6_78::-webkit-scrollbar-track{background:#f1f1f1}._content_12zm6_78::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}._content_12zm6_78::-webkit-scrollbar-thumb:hover{background:#a8a8a8}
@@ -0,0 +1 @@
1
+ ._input_w2bi0_1{width:100%;height:var(--dev-panel-inputs-height);border:0;border-radius:var(--dev-panel-border-radius);cursor:pointer;padding:0;background-color:transparent;color:var(--dev-panel-text-color-highlight)}._input_w2bi0_1:last-of-type{background-color:var(--dev-panel-input-background-color);padding-left:var(--dev-panel-spacing-xs)}._input_w2bi0_1:focus{outline:none}._input_w2bi0_1:disabled{cursor:not-allowed;opacity:.6}._input_w2bi0_1::placeholder{color:var(--dev-panel-text-color-muted)}
@@ -1 +1 @@
1
- ._section_1av28_1{padding-top:6px;padding-left:10px;padding-right:10px;overflow:hidden}._section_1av28_1:last-child{margin-bottom:0}._section_1av28_1:not(:first-of-type){border-top:1px solid #222;margin-top:8px}._section_1av28_1:last-of-type{padding-bottom:6px}._section_1av28_1 ._header_1av28_17{display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background .2s ease}._section_1av28_1 ._header_1av28_17 ._title_1av28_27{font-size:11px;font-weight:600;color:#333}._section_1av28_1 ._header_1av28_17 ._toggle_1av28_32{font-size:10px;color:#666;transition:transform .2s ease}._section_1av28_1 ._content_1av28_37{padding-left:10px;position:relative;display:grid;grid-template-columns:100%;row-gap:6px;transition:opacity .25s}._section_1av28_1 ._content_1av28_37:after{content:"";position:absolute;left:0;top:0;width:2px;height:100%;background-color:green;opacity:.4;transform:translate(-50%)}@media (prefers-color-scheme: dark){._section_1av28_1,._section_1av28_1 ._header_1av28_17{border-color:#555}._section_1av28_1 ._header_1av28_17 ._title_1av28_27{color:#e0e0e0}._section_1av28_1 ._toggle_1av28_32{color:#b0b0b0}}
1
+ ._section_1wq66_1{padding:var(--dev-panel-spacing-sm);overflow:hidden}._section_1wq66_1:last-child{margin-bottom:0}._section_1wq66_1 ._header_1wq66_8{display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:background .2s ease}._section_1wq66_1 ._header_1wq66_8 ._title_1wq66_15{font-size:11px;font-weight:600;color:var(--dev-panel-text-color)}._section_1wq66_1 ._header_1wq66_8 ._toggle_1wq66_20{font-size:10px;color:var(--dev-panel-border-color);transition:transform .2s ease}._section_1wq66_1 ._content_1wq66_25{position:relative;padding:var(--dev-panel-spacing-sm) 0 0 var(--dev-panel-spacing-sm);display:grid;grid-template-columns:100%;row-gap:var(--dev-panel-spacing-sm);transition:opacity .25s}._section_1wq66_1 ._content_1wq66_25:after{content:"";position:absolute;left:0;bottom:0;width:2px;height:calc(100% - var(--dev-panel-spacing-sm));background-color:var(--dev-panel-border-color);transform:translate(-50%)}@media (prefers-color-scheme: dark){._section_1wq66_1,._section_1wq66_1 ._header_1wq66_8{border-color:#555}._section_1wq66_1 ._header_1wq66_8 ._title_1wq66_15{color:#e0e0e0}._section_1wq66_1 ._toggle_1wq66_20{color:#b0b0b0}}
@@ -0,0 +1 @@
1
+ ._select_12f91_1{width:100%;height:var(--dev-panel-inputs-height);border:0;border-radius:var(--dev-panel-border-radius);cursor:pointer;padding:0;background-color:transparent;color:var(--dev-panel-text-color-highlight)}._select_12f91_1:last-of-type{background-color:var(--dev-panel-input-background-color);padding-left:var(--dev-panel-spacing-xs)}._select_12f91_1:focus{outline:none}._select_12f91_1:disabled{cursor:not-allowed;opacity:.6}._select_12f91_1::placeholder{color:var(--dev-panel-text-color-muted)}
@@ -1 +1 @@
1
- ._controlContainer_xw58o_1{grid-template-columns:auto 160px;column-gap:7px;display:grid;align-items:center;height:100%;overflow:hidden}._label_xw58o_10{font-weight:500;font-size:12px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._description_xw58o_24{font-size:10px;font-weight:400;color:#666;opacity:.8}@media (prefers-color-scheme: dark){._label_xw58o_10{color:#e0e0e0}._description_xw58o_24{color:#b0b0b0}}
1
+ ._controlContainer_5dtr1_1{gap:var(--dev-panel-spacing-sm);display:grid;height:100%;align-items:center;overflow:hidden;color:var(--dev-panel-text-color)}._controlContainer_5dtr1_1:not(._fullWidth_5dtr1_9){grid-template-columns:100px 1fr}._controlContainer_5dtr1_1 ._controlWrapper_5dtr1_12{display:flex;justify-content:flex-end}._controlContainer_5dtr1_1 ._label_5dtr1_16{text-align:start;font-weight:500;font-size:var(--dev-panel-font-size-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._description_5dtr1_25,._loading_5dtr1_26{font-size:var(--dev-panel-font-size-xs);color:var(--dev-panel-text-color-muted)}._description_5dtr1_25{text-align:right}
@@ -1,24 +1,25 @@
1
- import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
- import '../../../../assets/BooleanControl.css';const a = "_checkboxLabel_1m9o5_1", h = "_checkbox_1m9o5_1", t = "_checkboxCustom_1m9o5_15", e = {
3
- checkboxLabel: a,
4
- checkbox: h,
5
- checkboxCustom: t
1
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
+ import { className as t } from "../../../../utils/className/className.js";
3
+ import "../../../../utils/store/store.js";
4
+ import '../../../../assets/BooleanControl.css';const l = "_slider_1i71a_25", e = {
5
+ switch: "_switch_1i71a_1",
6
+ slider: l
6
7
  };
7
- function k({ control: c }) {
8
- return /* @__PURE__ */ b("label", { className: e.checkboxLabel, children: [
9
- /* @__PURE__ */ o(
8
+ function d({ control: s }) {
9
+ return /* @__PURE__ */ c("label", { className: e.switch, children: [
10
+ /* @__PURE__ */ a(
10
11
  "input",
11
12
  {
12
13
  type: "checkbox",
13
- checked: c.value,
14
- disabled: c.disabled,
15
- onChange: (s) => c.onChange(s.target.checked),
14
+ checked: s.value,
15
+ disabled: s.disabled,
16
+ onChange: (i) => s.onChange(i.target.checked),
16
17
  className: e.checkbox
17
18
  }
18
19
  ),
19
- /* @__PURE__ */ o("span", { className: e.checkboxCustom })
20
+ /* @__PURE__ */ a("span", { ...t(e.slider, e.round) })
20
21
  ] });
21
22
  }
22
23
  export {
23
- k as BooleanControl
24
+ d as BooleanControl
24
25
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import '../../../../assets/ButtonControl.css';const o = "_button_vlxsf_1", s = {
2
+ import '../../../../assets/ButtonControl.css';const o = "_button_e2m3l_1", e = {
3
3
  button: o
4
4
  };
5
- function b({ control: t }) {
6
- return /* @__PURE__ */ n("button", { onClick: t.onClick, disabled: t.disabled, className: s.button, children: t.label });
5
+ function s({ control: t }) {
6
+ return /* @__PURE__ */ n("button", { onClick: t.onClick, disabled: t.disabled, className: e.button, children: t.label });
7
7
  }
8
8
  export {
9
- b as ButtonControl
9
+ s as ButtonControl
10
10
  };
@@ -0,0 +1,2 @@
1
+ import { ButtonGroupControlProps } from './types';
2
+ export declare function ButtonGroupControl({ control }: ButtonGroupControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { ButtonControl as e } from "../ButtonControl/ButtonControl.js";
3
+ import '../../../../assets/ButtonGroupControl.css';const l = "_buttonGroupContainer_99d3t_1", i = {
4
+ buttonGroupContainer: l
5
+ };
6
+ function p({ control: n }) {
7
+ return /* @__PURE__ */ t("div", { className: i.buttonGroupContainer, children: n.buttons.map((o, r) => /* @__PURE__ */ t(
8
+ e,
9
+ {
10
+ control: {
11
+ type: "button",
12
+ label: o.label,
13
+ onClick: o.onClick,
14
+ disabled: o.disabled
15
+ }
16
+ },
17
+ r
18
+ )) });
19
+ }
20
+ export {
21
+ p as ButtonGroupControl
22
+ };
@@ -0,0 +1 @@
1
+ export * from './ButtonGroupControl';
@@ -0,0 +1,4 @@
1
+ import { ButtonGroupControl as t } from "./ButtonGroupControl.js";
2
+ export {
3
+ t as ButtonGroupControl
4
+ };
@@ -0,0 +1,14 @@
1
+ import { ButtonControl } from '../ButtonControl/types';
2
+ import { BaseControl } from '../types';
3
+ export interface ButtonGroupControl extends BaseControl {
4
+ type: "buttonGroup";
5
+ buttons: {
6
+ label: ButtonControl["label"];
7
+ onClick: ButtonControl["onClick"];
8
+ disabled?: ButtonControl["disabled"];
9
+ }[];
10
+ }
11
+
12
+ export interface ButtonGroupControlProps {
13
+ control: ButtonGroupControl;
14
+ }
@@ -1,19 +1,23 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import '../../../../assets/ColorControl.css';const n = "_colorInput_5ww2_1", l = {
3
- colorInput: n
1
+ import { jsxs as t, jsx as n } from "react/jsx-runtime";
2
+ import { Input as l } from "../../../Input/Input.js";
3
+ import '../../../../assets/ColorControl.css';const o = "_container_ds1no_1", r = {
4
+ container: o
4
5
  };
5
- function a({ control: o }) {
6
- return /* @__PURE__ */ e(
7
- "input",
8
- {
9
- type: "color",
10
- value: o.value,
11
- disabled: o.disabled,
12
- onChange: (t) => o.onChange(t.target.value),
13
- className: l.colorInput
14
- }
15
- );
6
+ function d({ control: e }) {
7
+ return /* @__PURE__ */ t("div", { className: r.container, children: [
8
+ /* @__PURE__ */ n("label", { children: /* @__PURE__ */ n(l, { type: "color", value: e.value, disabled: e.disabled, onChange: (a) => e.onChange(a.target.value) }) }),
9
+ /* @__PURE__ */ n(
10
+ l,
11
+ {
12
+ type: "text",
13
+ value: e.value,
14
+ disabled: e.disabled,
15
+ onChange: (a) => e.onChange(a.target.value),
16
+ placeholder: "Enter color value"
17
+ }
18
+ )
19
+ ] });
16
20
  }
17
21
  export {
18
- a as ColorControl
22
+ d as ColorControl
19
23
  };
@@ -1,14 +1,28 @@
1
1
  import { NumberControlProps } from './types';
2
2
  /**
3
- * Component that renders a number control
3
+ * Component that renders a number control with configurable event handling
4
4
  * @param control - The control to render
5
+ * @param control.event - When to trigger onChange: "onChange" (real-time) or "onBlur" (on focus loss). Defaults to "onBlur"
5
6
  * @returns The number control component
6
7
  *
7
8
  * @example
8
9
  * ```typescript
10
+ * // Real-time updates
9
11
  * <NumberControl control={{
10
12
  * type: 'number',
11
13
  * value: 10,
14
+ * min: 0,
15
+ * max: 100,
16
+ * step: 1,
17
+ * event: 'onChange',
18
+ * onChange: (value) => setValue(value)
19
+ * }} />
20
+ *
21
+ * // Updates only when losing focus (default behavior)
22
+ * <NumberControl control={{
23
+ * type: 'number',
24
+ * value: 10,
25
+ * event: 'onBlur', // or omit for default
12
26
  * onChange: (value) => setValue(value)
13
27
  * }} />
14
28
  * ```
@@ -1,22 +1,32 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import '../../../../assets/NumberControl.css';const m = "_numberInput_pm0en_1", t = {
3
- numberInput: m
4
- };
5
- function p({ control: e }) {
6
- return /* @__PURE__ */ u(
7
- "input",
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useState as i, useEffect as p } from "react";
3
+ import { Input as f } from "../../../Input/Input.js";
4
+ function h({ control: e }) {
5
+ const n = e.event || "onBlur", [l, t] = i(e.value);
6
+ p(() => {
7
+ t(e.value);
8
+ }, [e.value]);
9
+ const m = (u) => {
10
+ const a = Number(u.target.value);
11
+ t(a), n === "onChange" && e.onChange(a);
12
+ }, s = (u) => {
13
+ const a = Number(u.target.value);
14
+ n === "onBlur" && e.onChange(a);
15
+ };
16
+ return /* @__PURE__ */ r(
17
+ f,
8
18
  {
9
19
  type: "number",
10
- value: e.value,
20
+ value: l,
11
21
  min: e.min,
12
22
  max: e.max,
13
23
  step: e.step,
14
24
  disabled: e.disabled,
15
- onChange: (n) => e.onChange(Number(n.target.value)),
16
- className: t.numberInput
25
+ onChange: m,
26
+ ...n === "onBlur" && { onBlur: s }
17
27
  }
18
28
  );
19
29
  }
20
30
  export {
21
- p as NumberControl
31
+ h as NumberControl
22
32
  };
@@ -1,5 +1,5 @@
1
- import { BaseControl } from '../types';
2
- export interface NumberControl extends BaseControl {
1
+ import { BaseInputControl } from '../types';
2
+ export interface NumberControl extends BaseInputControl {
3
3
  type: "number";
4
4
  value: number;
5
5
  min?: number;
@@ -1,13 +1,14 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import '../../../../assets/SelectControl.css';const n = "_select_1w3k9_1", c = {
3
- select: n
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { Select as n } from "../../../Select/Select.js";
3
+ import '../../../../assets/SelectControl.css';const r = "_select_1w3k9_1", c = {
4
+ select: r
4
5
  };
5
- function u({ control: l }) {
6
- return /* @__PURE__ */ t("select", { value: l.value, disabled: l.disabled, onChange: (e) => l.onChange(e.target.value), className: c.select, children: l.options.map((e) => {
7
- const s = typeof e == "string" ? e : e.value, a = typeof e == "string" ? e : e.label;
8
- return /* @__PURE__ */ t("option", { value: s, children: a }, s);
6
+ function o({ control: t }) {
7
+ return /* @__PURE__ */ s(n, { value: t.value, disabled: t.disabled, onChange: (e) => t.onChange(e.target.value), className: c.select, children: t.options.map((e) => {
8
+ const l = typeof e == "string" ? e : e.value, a = typeof e == "string" ? e : e.label;
9
+ return /* @__PURE__ */ s("option", { value: l, children: a }, l);
9
10
  }) });
10
11
  }
11
12
  export {
12
- u as SelectControl
13
+ o as SelectControl
13
14
  };
@@ -1,15 +1,27 @@
1
1
  import { TextControlProps } from './types';
2
2
  /**
3
- * Component that renders a text control
3
+ * Component that renders a text control with configurable event handling
4
4
  * @param control - The control to render
5
+ * @param control.event - When to trigger onChange: "onChange" (real-time) or "onBlur" (on focus loss). Defaults to "onBlur"
5
6
  * @returns The text control component
6
7
  *
7
8
  * @example
8
9
  * ```typescript
10
+ * // Real-time updates
9
11
  * <TextControl control={{
10
12
  * type: 'text',
11
13
  * value: 'Hello',
12
14
  * placeholder: 'Enter your name',
15
+ * event: 'onChange',
16
+ * onChange: (value) => setValue(value)
17
+ * }} />
18
+ *
19
+ * // Updates only when losing focus (default behavior)
20
+ * <TextControl control={{
21
+ * type: 'text',
22
+ * value: 'Hello',
23
+ * placeholder: 'Enter your name',
24
+ * event: 'onBlur', // or omit for default
13
25
  * onChange: (value) => setValue(value)
14
26
  * }} />
15
27
  * ```
@@ -1,20 +1,30 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import '../../../../assets/TextControl.css';const n = "_textInput_w4cvv_1", p = {
3
- textInput: n
4
- };
5
- function l({ control: t }) {
6
- return /* @__PURE__ */ a(
7
- "input",
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useState as h, useEffect as p } from "react";
3
+ import { Input as d } from "../../../Input/Input.js";
4
+ function g({ control: e }) {
5
+ const n = e.event || "onBlur", [u, l] = h(e.value);
6
+ p(() => {
7
+ l(e.value);
8
+ }, [e.value]);
9
+ const o = (t) => {
10
+ const a = t.target.value;
11
+ l(a), n === "onChange" && e.onChange(a);
12
+ }, r = (t) => {
13
+ const a = t.target.value;
14
+ n === "onBlur" && e.onChange(a);
15
+ };
16
+ return /* @__PURE__ */ s(
17
+ d,
8
18
  {
9
19
  type: "text",
10
- value: t.value,
11
- placeholder: t.placeholder,
12
- disabled: t.disabled,
13
- onChange: (e) => t.onChange(e.target.value),
14
- className: p.textInput
20
+ value: u,
21
+ placeholder: e.placeholder,
22
+ disabled: e.disabled,
23
+ onChange: o,
24
+ ...n === "onBlur" && { onBlur: r }
15
25
  }
16
26
  );
17
27
  }
18
28
  export {
19
- l as TextControl
29
+ g as TextControl
20
30
  };
@@ -1,9 +1,8 @@
1
- import { BaseControl } from '../types';
2
- export interface TextControl extends BaseControl {
1
+ import { BaseInputControl } from '../types';
2
+ export interface TextControl extends BaseInputControl {
3
3
  type: "text";
4
4
  value: string;
5
5
  placeholder?: string;
6
- onChange: (value: string) => void;
7
6
  }
8
7
 
9
8
  export interface TextControlProps {
@@ -9,5 +9,6 @@ export declare const controls: Readonly<{
9
9
  number: import('react').LazyExoticComponent<typeof import('./NumberControl').NumberControl>;
10
10
  select: import('react').LazyExoticComponent<typeof import('./SelectControl').SelectControl>;
11
11
  text: import('react').LazyExoticComponent<typeof import('./TextControl').TextControl>;
12
+ buttonGroup: import('react').LazyExoticComponent<typeof import('./ButtonGroupControl').ButtonGroupControl>;
12
13
  }>;
13
14
  export { ControlRenderer } from '..';
@@ -1,37 +1,41 @@
1
- import { Suspense as c, lazy as o } from "react";
2
- import { jsxs as i, jsx as n } from "react/jsx-runtime";
3
- import { className as d } from "../../../utils/className/className.js";
1
+ import { Suspense as c, lazy as e } from "react";
2
+ import { jsxs as i, Fragment as s, jsx as n } from "react/jsx-runtime";
3
+ import { className as p } from "../../../utils/className/className.js";
4
4
  import "../../../utils/store/store.js";
5
- import '../../../assets/index.css';const p = "_controlContainer_xw58o_1", m = "_label_xw58o_10", u = "_description_xw58o_24", r = {
6
- controlContainer: p,
7
- label: m,
8
- description: u
9
- };
10
- function x({ name: e, control: t }) {
11
- const s = t?.label || e;
5
+ import '../../../assets/index.css';const u = "_controlContainer_5dtr1_1", m = "_fullWidth_5dtr1_9", f = "_controlWrapper_5dtr1_12", h = "_label_5dtr1_16", C = "_description_5dtr1_25", _ = "_loading_5dtr1_26", r = {
6
+ controlContainer: u,
7
+ fullWidth: m,
8
+ controlWrapper: f,
9
+ label: h,
10
+ description: C,
11
+ loading: _
12
+ }, b = ["button", "buttonGroup"];
13
+ function x({ name: t, control: o }) {
14
+ const d = o?.label || t;
12
15
  function a() {
13
- if (!t || !t.type)
16
+ if (!o || !o.type)
14
17
  return /* @__PURE__ */ n("div", { className: r.error, children: "Control type is not defined" });
15
- const l = f[t.type];
16
- return l ? /* @__PURE__ */ n(c, { fallback: /* @__PURE__ */ n("div", { children: "Loading control..." }), children: /* @__PURE__ */ n(l, { control: t }) }) : /* @__PURE__ */ n("div", { children: "Unknown control type" });
18
+ const l = y[o.type];
19
+ return l ? /* @__PURE__ */ n(c, { fallback: /* @__PURE__ */ n("div", { className: r.loading, children: "Loading control..." }), children: /* @__PURE__ */ n(l, { control: o }) }) : /* @__PURE__ */ n("div", { children: "Unknown control type" });
17
20
  }
18
- return /* @__PURE__ */ i("div", { ...d(r.controlContainer), children: [
19
- t?.type !== "button" && /* @__PURE__ */ i("label", { className: r.label, children: [
20
- s,
21
- t?.description && /* @__PURE__ */ n("span", { className: r.description, children: t.description })
21
+ return /* @__PURE__ */ i(s, { children: [
22
+ /* @__PURE__ */ i("div", { ...p(r.controlContainer, { [r.fullWidth]: b.includes(o.type) }), children: [
23
+ o?.type !== "button" && /* @__PURE__ */ n("label", { className: r.label, children: d }),
24
+ /* @__PURE__ */ n("div", { className: r.controlWrapper, children: a() })
22
25
  ] }),
23
- a()
26
+ o?.description && /* @__PURE__ */ n("span", { className: r.description, children: o.description })
24
27
  ] });
25
28
  }
26
- const f = Object.freeze({
27
- boolean: o(() => import("./BooleanControl/index.js").then((e) => ({ default: e.BooleanControl }))),
28
- button: o(() => import("./ButtonControl/index.js").then((e) => ({ default: e.ButtonControl }))),
29
- color: o(() => import("./ColorControl/index.js").then((e) => ({ default: e.ColorControl }))),
30
- number: o(() => import("./NumberControl/index.js").then((e) => ({ default: e.NumberControl }))),
31
- select: o(() => import("./SelectControl/index.js").then((e) => ({ default: e.SelectControl }))),
32
- text: o(() => import("./TextControl/index.js").then((e) => ({ default: e.TextControl })))
29
+ const y = Object.freeze({
30
+ boolean: e(() => import("./BooleanControl/index.js").then((t) => ({ default: t.BooleanControl }))),
31
+ button: e(() => import("./ButtonControl/index.js").then((t) => ({ default: t.ButtonControl }))),
32
+ color: e(() => import("./ColorControl/index.js").then((t) => ({ default: t.ColorControl }))),
33
+ number: e(() => import("./NumberControl/index.js").then((t) => ({ default: t.NumberControl }))),
34
+ select: e(() => import("./SelectControl/index.js").then((t) => ({ default: t.SelectControl }))),
35
+ text: e(() => import("./TextControl/index.js").then((t) => ({ default: t.TextControl }))),
36
+ buttonGroup: e(() => import("./ButtonGroupControl/index.js").then((t) => ({ default: t.ButtonGroupControl })))
33
37
  });
34
38
  export {
35
39
  x as ControlRenderer,
36
- f as controls
40
+ y as controls
37
41
  };
@@ -1,5 +1,6 @@
1
1
  import { BooleanControl } from './BooleanControl/types';
2
2
  import { ButtonControl } from './ButtonControl/types';
3
+ import { ButtonGroupControl } from './ButtonGroupControl/types';
3
4
  import { ColorControl } from './ColorControl/types';
4
5
  import { NumberControl } from './NumberControl/types';
5
6
  import { SelectControl } from './SelectControl/types';
@@ -10,6 +11,11 @@ export interface BaseControl {
10
11
  disabled?: boolean;
11
12
  }
12
13
 
14
+ export interface BaseInputControl extends BaseControl {
15
+ event?: "onBlur" | "onChange";
16
+ onChange: (value: string) => void;
17
+ }
18
+
13
19
  export type Controls = {
14
20
  color: ColorControl;
15
21
  boolean: BooleanControl;
@@ -17,6 +23,7 @@ export type Controls = {
17
23
  text: TextControl;
18
24
  button: ButtonControl;
19
25
  number: NumberControl;
26
+ buttonGroup: ButtonGroupControl;
20
27
  };
21
28
 
22
29
  export type ControlsNames = keyof Controls;
@@ -1,74 +1,65 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { useCallback as v } from "react";
2
+ import { useCallback as C } from "react";
3
3
  import { useDragAndDrop as _ } from "../../hooks/useDragAndDrop/useDragAndDrop.js";
4
- import { useHotkey as C } from "../../hooks/useHotkeys/useHotkey.js";
5
- import { className as D } from "../../utils/className/className.js";
6
- import { useDevPanelVisible as P, useDevPanelCollapsed as y, useDevPanelPosition as k, useDevPanelSections as b, useDevPanelActions as N } from "../../utils/store/store.js";
7
- import { EmptyContent as K } from "../EmptyContent/EmptyContent.js";
4
+ import { useHotkey as D } from "../../hooks/useHotkeys/useHotkey.js";
5
+ import { className as P } from "../../utils/className/className.js";
6
+ import { useDevPanelVisible as b, useDevPanelCollapsed as g, useDevPanelPosition as y, useDevPanelSections as N, useDevPanelActions as K } from "../../utils/store/store.js";
7
+ import { EmptyContent as k } from "../EmptyContent/EmptyContent.js";
8
8
  import { Section as x } from "../Section/Section.js";
9
- import '../../assets/DevPanel.css';const B = "_devPanelContainer_k5g13_21", E = "_header_k5g13_34", V = "_title_k5g13_47", j = "_headerButton_k5g13_56", w = "_content_k5g13_74", S = "_dragging_k5g13_168", e = {
10
- devPanelContainer: B,
9
+ import '../../assets/DevPanel.css';const z = "_devPanelContainer_12zm6_30", E = "_header_12zm6_41", V = "_title_12zm6_50", j = "_button_12zm6_60", w = "_content_12zm6_78", e = {
10
+ devPanelContainer: z,
11
11
  header: E,
12
12
  title: V,
13
- headerButton: j,
14
- content: w,
15
- dragging: S
16
- }, A = {
13
+ button: j,
14
+ content: w
15
+ }, S = {
17
16
  key: "f",
18
17
  shiftKey: !0,
19
18
  altKey: !0,
20
19
  ctrlKey: !1,
21
20
  metaKey: !1
22
21
  };
23
- function G({ panelTitle: c = "Dev panel", ...d }) {
24
- const i = P(), n = y(), a = k(), g = b(), o = N(), u = v(
22
+ function F({ panelTitle: c = "Dev panel", ...m }) {
23
+ const i = b(), n = g(), l = y(), d = N(), o = K(), u = C(
25
24
  (s) => {
26
25
  o.setPosition(s);
27
26
  },
28
27
  [o]
29
- ), { isDragging: m, elementRef: h, handleMouseDown: p } = _({
28
+ ), { isDragging: p, elementRef: f, handleMouseDown: h } = _({
30
29
  onPositionChange: u
31
30
  });
32
- if (C({
31
+ if (D({
33
32
  description: "Show Dev Panel",
34
33
  preventDefault: !0,
35
34
  action: () => o.setVisible(!i),
36
- ...A,
37
- ...d.hotKeyConfig
35
+ ...S,
36
+ ...m.hotKeyConfig
38
37
  }), process.env.NODE_ENV !== "development" || !i)
39
38
  return null;
40
- const l = Object.entries(g);
39
+ const a = Object.entries(d);
41
40
  return /* @__PURE__ */ r(
42
41
  "div",
43
42
  {
44
- ref: h,
45
- ...D(e.devPanelContainer, {
46
- [e.dragging]: m
43
+ ref: f,
44
+ ...P(e.devPanelContainer, {
45
+ [e.dragging]: p
47
46
  }),
48
47
  style: {
49
- left: a.x,
50
- top: a.y,
48
+ left: l.x,
49
+ top: l.y,
51
50
  height: n ? "auto" : void 0
52
51
  },
53
52
  children: [
54
- /* @__PURE__ */ r("div", { className: e.header, onMouseDown: p, children: [
55
- /* @__PURE__ */ t(
56
- "button",
57
- {
58
- className: e.headerButton,
59
- onClick: () => o.setCollapsed(!n),
60
- title: n ? "Expand" : "Collapse",
61
- children: n ? "▼" : "▲"
62
- }
63
- ),
53
+ /* @__PURE__ */ r("div", { className: e.header, onMouseDown: h, children: [
54
+ /* @__PURE__ */ t("button", { className: e.button, onClick: () => o.setCollapsed(!n), title: n ? "Expand" : "Collapse", children: n ? "▼" : "▲" }),
64
55
  /* @__PURE__ */ t("div", { className: e.title, children: c }),
65
- /* @__PURE__ */ t("button", { className: e.headerButton, onClick: () => o.setVisible(!1), title: "Close", children: "✕" })
56
+ /* @__PURE__ */ t("button", { className: e.button, onClick: () => o.setVisible(!1), title: "Close", children: "✕" })
66
57
  ] }),
67
- !n && /* @__PURE__ */ t("div", { className: e.content, children: l.length ? l.map(([s, f]) => /* @__PURE__ */ t(x, { sectionName: s, section: f }, `section-${s}`)) : /* @__PURE__ */ t(K, {}) })
58
+ !n && /* @__PURE__ */ t("div", { className: e.content, children: a.length ? a.map(([s, v]) => /* @__PURE__ */ t(x, { sectionName: s, section: v }, `section-${s}`)) : /* @__PURE__ */ t(k, {}) })
68
59
  ]
69
60
  }
70
61
  );
71
62
  }
72
63
  export {
73
- G as DevPanel
64
+ F as DevPanel
74
65
  };
@@ -0,0 +1 @@
1
+ export declare function Input(props: React.InputHTMLAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import '../../assets/Input.css';const i = "_input_w2bi0_1", p = {
3
+ input: i
4
+ };
5
+ function s(t) {
6
+ return /* @__PURE__ */ n("input", { ...t, className: p.input });
7
+ }
8
+ export {
9
+ s as Input
10
+ };
@@ -0,0 +1 @@
1
+ export * from './Input';
@@ -0,0 +1,4 @@
1
+ import { Input as r } from "./Input.js";
2
+ export {
3
+ r as Input
4
+ };
@@ -1,23 +1,23 @@
1
1
  import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
- import { ControlRenderer as i } from "../ControlRenderer/controls/index.js";
2
+ import { ControlRenderer as a } from "../ControlRenderer/controls/index.js";
3
3
  import { useDevPanelActions as r } from "../../utils/store/store.js";
4
- import '../../assets/Section.css';const d = "_section_1av28_1", _ = "_header_1av28_17", m = "_title_1av28_27", g = "_toggle_1av28_32", p = "_content_1av28_37", e = {
4
+ import '../../assets/Section.css';const d = "_section_1wq66_1", _ = "_header_1wq66_8", m = "_title_1wq66_15", g = "_toggle_1wq66_20", p = "_content_1wq66_25", e = {
5
5
  section: d,
6
6
  header: _,
7
7
  title: m,
8
8
  toggle: g,
9
9
  content: p
10
10
  };
11
- function f({ sectionName: c, section: t }) {
11
+ function C({ sectionName: c, section: t }) {
12
12
  const l = r();
13
13
  return /* @__PURE__ */ s("div", { className: e.section, children: [
14
14
  /* @__PURE__ */ s("div", { className: e.header, onClick: () => l.toggleSectionCollapse(c), children: [
15
15
  /* @__PURE__ */ n("span", { className: e.title, children: t.name }),
16
16
  /* @__PURE__ */ n("span", { className: e.toggle, children: t.isCollapsed ? "▶" : "▼" })
17
17
  ] }),
18
- !t.isCollapsed && /* @__PURE__ */ n("div", { className: e.content, children: Object.entries(t.controls).map(([o, a]) => /* @__PURE__ */ n(i, { name: o, control: a }, o)) })
18
+ !t.isCollapsed && /* @__PURE__ */ n("div", { className: e.content, children: Object.entries(t.controls).map(([o, i]) => /* @__PURE__ */ n(a, { name: o, control: i }, o)) })
19
19
  ] });
20
20
  }
21
21
  export {
22
- f as Section
22
+ C as Section
23
23
  };
@@ -0,0 +1 @@
1
+ export declare function Select(props: React.SelectHTMLAttributes<HTMLSelectElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import '../../assets/Select.css';const s = "_select_12f91_1", c = {
3
+ select: s
4
+ };
5
+ function o(e) {
6
+ return /* @__PURE__ */ t("select", { ...e, className: c.select });
7
+ }
8
+ export {
9
+ o as Select
10
+ };
@@ -0,0 +1 @@
1
+ export * from './Select';
@@ -0,0 +1,4 @@
1
+ import { Select as r } from "./Select.js";
2
+ export {
3
+ r as Select
4
+ };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "url": "git+https://github.com/Berenjenas/react-dev-panel.git"
16
16
  },
17
17
  "private": false,
18
- "version": "0.0.1-beta.4",
18
+ "version": "0.0.1-beta.6",
19
19
  "type": "module",
20
20
  "files": [
21
21
  "dist"
@@ -60,8 +60,8 @@
60
60
  "test": "vitest"
61
61
  },
62
62
  "peerDependencies": {
63
- "react": "^19.1.0",
64
- "react-dom": "^19.1.0",
63
+ "react": ">=18.0.0",
64
+ "react-dom": ">=18.0.0",
65
65
  "zustand": "^5.0.6"
66
66
  },
67
67
  "devDependencies": {
@@ -1 +0,0 @@
1
- ._numberInput_pm0en_1{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;background-color:#fff}._numberInput_pm0en_1:focus{outline:none;border-color:#4caf50;box-shadow:0 0 0 2px #4caf5033}._numberInput_pm0en_1:disabled{background-color:#f5f5f5;cursor:not-allowed}
@@ -1 +0,0 @@
1
- ._textInput_w4cvv_1{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;background-color:#fff}._textInput_w4cvv_1:focus{outline:none;border-color:#4caf50;box-shadow:0 0 0 2px #4caf5033}._textInput_w4cvv_1:disabled{background-color:#f5f5f5;cursor:not-allowed}._textInput_w4cvv_1::placeholder{color:#999}
@@ -1,5 +0,0 @@
1
- /**
2
- * Ejemplo de uso del hook useHotkeys
3
- * Este componente demuestra diferentes formas de usar el hook
4
- */
5
- export declare function HotkeysExample(): import("react/jsx-runtime").JSX.Element;
@@ -1,266 +0,0 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useState as p, useCallback as o } from "react";
3
- import { createHotkey as y } from "../../utils/createHotkey/createHotkey.js";
4
- import { useHotkeys as m } from "./useHotkeys.js";
5
- function w() {
6
- const [d, s] = p(""), [l, a] = p(!1), [r, f] = p([]), [n, u] = p(-1), g = o(() => {
7
- if (d.trim()) {
8
- const t = [...r, d];
9
- f(t), u(t.length - 1), alert(`Guardado: "${d}"`);
10
- }
11
- }, [d, r]), h = o(() => {
12
- s(""), a(!1);
13
- }, []), x = o(() => {
14
- if (n > 0) {
15
- const t = n - 1;
16
- s(r[t]), u(t);
17
- }
18
- }, [r, n]), k = o(() => {
19
- if (n < r.length - 1) {
20
- const t = n + 1;
21
- s(r[t]), u(t);
22
- }
23
- }, [r, n]), b = o(() => {
24
- l && a(!1);
25
- }, [l]), E = o(() => {
26
- a(!l);
27
- }, [l]), K = o(() => {
28
- const t = document.getElementById("example-input");
29
- t && t.focus();
30
- }, []);
31
- m(
32
- [
33
- {
34
- key: "s",
35
- ctrlKey: !0,
36
- action: g,
37
- description: "Guardar",
38
- preventDefault: !0
39
- },
40
- {
41
- key: "z",
42
- ctrlKey: !0,
43
- action: x,
44
- description: "Deshacer",
45
- preventDefault: !0
46
- },
47
- {
48
- key: "z",
49
- ctrlKey: !0,
50
- shiftKey: !0,
51
- action: k,
52
- description: "Rehacer",
53
- preventDefault: !0
54
- },
55
- {
56
- key: "Escape",
57
- action: b,
58
- description: "Cancelar edición"
59
- },
60
- {
61
- key: "e",
62
- ctrlKey: !0,
63
- action: E,
64
- description: "Alternar edición",
65
- preventDefault: !0
66
- },
67
- {
68
- key: "l",
69
- ctrlKey: !0,
70
- action: h,
71
- description: "Limpiar",
72
- preventDefault: !0
73
- },
74
- {
75
- key: "f",
76
- ctrlKey: !0,
77
- action: K,
78
- description: "Enfocar input",
79
- preventDefault: !0
80
- }
81
- ],
82
- {
83
- enabled: !0,
84
- target: window
85
- }
86
- );
87
- const v = y(
88
- "k",
89
- () => {
90
- alert("Función de búsqueda activada!");
91
- },
92
- { meta: !0 },
93
- { description: "Buscar" }
94
- ), C = y(
95
- "Delete",
96
- () => {
97
- h();
98
- },
99
- {},
100
- { description: "Eliminar todo", enabled: l }
101
- );
102
- m([v, C]);
103
- const H = [
104
- { key: "s", ctrlKey: !0, description: "Guardar" },
105
- { key: "z", ctrlKey: !0, description: "Deshacer" },
106
- { key: "z", ctrlKey: !0, shiftKey: !0, description: "Rehacer" },
107
- { key: "e", ctrlKey: !0, description: "Alternar edición" },
108
- { key: "l", ctrlKey: !0, description: "Limpiar" },
109
- { key: "f", ctrlKey: !0, description: "Enfocar input" },
110
- { key: "k", metaKey: !0, description: "Buscar" },
111
- { key: "Delete", description: "Eliminar todo (solo en modo edición)" },
112
- { key: "Escape", description: "Cancelar edición" }
113
- ];
114
- return /* @__PURE__ */ i("div", { style: { padding: "20px", maxWidth: "600px", margin: "0 auto" }, children: [
115
- /* @__PURE__ */ e("h2", { children: "Ejemplo de useHotkeys Hook" }),
116
- /* @__PURE__ */ i("div", { style: { marginBottom: "20px" }, children: [
117
- /* @__PURE__ */ e("label", { htmlFor: "example-input", children: "Texto:" }),
118
- /* @__PURE__ */ e(
119
- "input",
120
- {
121
- id: "example-input",
122
- type: "text",
123
- value: d,
124
- onChange: (t) => s(t.target.value),
125
- onFocus: () => a(!0),
126
- onBlur: () => a(!1),
127
- style: {
128
- width: "100%",
129
- padding: "10px",
130
- margin: "5px 0",
131
- border: l ? "2px solid blue" : "1px solid gray",
132
- borderRadius: "4px"
133
- },
134
- placeholder: "Escribe algo aquí..."
135
- }
136
- )
137
- ] }),
138
- /* @__PURE__ */ i("div", { style: { marginBottom: "20px" }, children: [
139
- /* @__PURE__ */ i("p", { children: [
140
- /* @__PURE__ */ e("strong", { children: "Estado:" }),
141
- " ",
142
- l ? "Editando" : "No editando"
143
- ] }),
144
- /* @__PURE__ */ i("p", { children: [
145
- /* @__PURE__ */ e("strong", { children: "Historial:" }),
146
- " ",
147
- r.length,
148
- " elementos"
149
- ] }),
150
- /* @__PURE__ */ i("p", { children: [
151
- /* @__PURE__ */ e("strong", { children: "Posición en historial:" }),
152
- " ",
153
- n + 1,
154
- " ",
155
- "de ",
156
- r.length
157
- ] })
158
- ] }),
159
- /* @__PURE__ */ i("div", { style: { marginBottom: "20px" }, children: [
160
- /* @__PURE__ */ e("h3", { children: "Hotkeys disponibles:" }),
161
- /* @__PURE__ */ e("ul", { style: { listStyle: "none", padding: 0 }, children: H.map((t, c) => /* @__PURE__ */ i(
162
- "li",
163
- {
164
- style: {
165
- padding: "5px 0",
166
- borderBottom: "1px solid #eee",
167
- display: "flex",
168
- justifyContent: "space-between"
169
- },
170
- children: [
171
- /* @__PURE__ */ e("span", { children: t.description }),
172
- /* @__PURE__ */ e(
173
- "code",
174
- {
175
- style: {
176
- backgroundColor: "#f5f5f5",
177
- padding: "2px 6px",
178
- borderRadius: "3px",
179
- fontSize: "12px"
180
- },
181
- children: [
182
- t.ctrlKey && "Ctrl",
183
- t.altKey && "Alt",
184
- t.shiftKey && "Shift",
185
- t.metaKey && "⌘",
186
- t.key.toUpperCase()
187
- ].filter(Boolean).join("+")
188
- }
189
- )
190
- ]
191
- },
192
- c
193
- )) })
194
- ] }),
195
- /* @__PURE__ */ i("div", { style: { marginBottom: "20px" }, children: [
196
- /* @__PURE__ */ e("h3", { children: "Historial:" }),
197
- /* @__PURE__ */ e("ul", { children: r.map((t, c) => /* @__PURE__ */ e(
198
- "li",
199
- {
200
- style: {
201
- padding: "5px 0",
202
- opacity: c === n ? 1 : 0.6,
203
- fontWeight: c === n ? "bold" : "normal"
204
- },
205
- children: t
206
- },
207
- c
208
- )) })
209
- ] }),
210
- /* @__PURE__ */ i(
211
- "div",
212
- {
213
- style: {
214
- backgroundColor: "#f9f9f9",
215
- padding: "15px",
216
- borderRadius: "5px",
217
- fontSize: "14px"
218
- },
219
- children: [
220
- /* @__PURE__ */ e("p", { children: /* @__PURE__ */ e("strong", { children: "Instrucciones:" }) }),
221
- /* @__PURE__ */ i("ul", { children: [
222
- /* @__PURE__ */ e("li", { children: "Escribe algo en el input" }),
223
- /* @__PURE__ */ i("li", { children: [
224
- "Usa ",
225
- /* @__PURE__ */ e("code", { children: "Ctrl+S" }),
226
- " para guardar"
227
- ] }),
228
- /* @__PURE__ */ i("li", { children: [
229
- "Usa ",
230
- /* @__PURE__ */ e("code", { children: "Ctrl+Z" }),
231
- " para deshacer"
232
- ] }),
233
- /* @__PURE__ */ i("li", { children: [
234
- "Usa ",
235
- /* @__PURE__ */ e("code", { children: "Ctrl+Shift+Z" }),
236
- " para rehacer"
237
- ] }),
238
- /* @__PURE__ */ i("li", { children: [
239
- "Usa ",
240
- /* @__PURE__ */ e("code", { children: "Ctrl+E" }),
241
- " para alternar modo edición"
242
- ] }),
243
- /* @__PURE__ */ i("li", { children: [
244
- "Usa ",
245
- /* @__PURE__ */ e("code", { children: "Ctrl+L" }),
246
- " para limpiar"
247
- ] }),
248
- /* @__PURE__ */ i("li", { children: [
249
- "Usa ",
250
- /* @__PURE__ */ e("code", { children: "Escape" }),
251
- " para cancelar edición"
252
- ] }),
253
- /* @__PURE__ */ i("li", { children: [
254
- "Usa ",
255
- /* @__PURE__ */ e("code", { children: "Delete" }),
256
- " para eliminar todo (solo en modo edición)"
257
- ] })
258
- ] })
259
- ]
260
- }
261
- )
262
- ] });
263
- }
264
- export {
265
- w as HotkeysExample
266
- };