react-science 20.5.0 → 20.6.0

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 (68) hide show
  1. package/lib/components/accordion/accordion_context_provider.d.ts.map +1 -1
  2. package/lib/components/accordion/accordion_context_provider.js +1 -1
  3. package/lib/components/accordion/accordion_context_provider.js.map +1 -1
  4. package/lib/components/color-picker/index.d.ts +2 -0
  5. package/lib/components/color-picker/index.d.ts.map +1 -1
  6. package/lib/components/color-picker/index.js +1 -0
  7. package/lib/components/color-picker/index.js.map +1 -1
  8. package/lib/components/color-picker/preview/ColorPreview.d.ts +1 -8
  9. package/lib/components/color-picker/preview/ColorPreview.d.ts.map +1 -1
  10. package/lib/components/color-picker/preview/ColorPreview.js +1 -1
  11. package/lib/components/color-picker/preview/ColorPreview.js.map +1 -1
  12. package/lib/components/color-picker/preview/color_config.d.ts +14 -0
  13. package/lib/components/color-picker/preview/color_config.d.ts.map +1 -0
  14. package/lib/components/color-picker/preview/color_config.js +11 -0
  15. package/lib/components/color-picker/preview/color_config.js.map +1 -0
  16. package/lib/components/draggable/draggable.d.ts +18 -0
  17. package/lib/components/draggable/draggable.d.ts.map +1 -0
  18. package/lib/components/draggable/draggable.js +70 -0
  19. package/lib/components/draggable/draggable.js.map +1 -0
  20. package/lib/components/form/components/field_groups/svg_line_style.d.ts +2 -0
  21. package/lib/components/form/components/field_groups/svg_line_style.d.ts.map +1 -1
  22. package/lib/components/form/components/field_groups/svg_text_style.d.ts +2 -0
  23. package/lib/components/form/components/field_groups/svg_text_style.d.ts.map +1 -1
  24. package/lib/components/form/components/input/draggable_numeric_input.d.ts +10 -0
  25. package/lib/components/form/components/input/draggable_numeric_input.d.ts.map +1 -0
  26. package/lib/components/form/components/input/draggable_numeric_input.js +29 -0
  27. package/lib/components/form/components/input/draggable_numeric_input.js.map +1 -0
  28. package/lib/components/form/components/input/index.d.ts +1 -0
  29. package/lib/components/form/components/input/index.d.ts.map +1 -1
  30. package/lib/components/form/components/input/numeric_input.d.ts +1 -2
  31. package/lib/components/form/components/input/numeric_input.d.ts.map +1 -1
  32. package/lib/components/form/components/input/numeric_input.js.map +1 -1
  33. package/lib/components/form/components/input_groups/form_group.d.ts +1 -0
  34. package/lib/components/form/components/input_groups/form_group.d.ts.map +1 -1
  35. package/lib/components/form/components/input_groups/form_group.js +4 -4
  36. package/lib/components/form/components/input_groups/form_group.js.map +1 -1
  37. package/lib/components/form/components/layout/form.d.ts +1 -0
  38. package/lib/components/form/components/layout/form.d.ts.map +1 -1
  39. package/lib/components/form/context/use_ts_form.d.ts +7 -0
  40. package/lib/components/form/context/use_ts_form.d.ts.map +1 -1
  41. package/lib/components/form/context/use_ts_form.js +2 -0
  42. package/lib/components/form/context/use_ts_form.js.map +1 -1
  43. package/lib/components/table/reorder_rows/draggable_row_tr.js +1 -1
  44. package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
  45. package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
  46. package/lib/components/table/reorder_rows/use_drop_monitor.js +1 -1
  47. package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
  48. package/lib/components/utils/assert.d.ts +13 -0
  49. package/lib/components/utils/assert.d.ts.map +1 -1
  50. package/lib/components/utils/assert.js +13 -0
  51. package/lib/components/utils/assert.js.map +1 -1
  52. package/lib/components/utils/svg.js +1 -1
  53. package/lib/components/utils/svg.js.map +1 -1
  54. package/package.json +2 -1
  55. package/src/components/accordion/accordion_context_provider.tsx +1 -2
  56. package/src/components/color-picker/index.ts +5 -0
  57. package/src/components/color-picker/preview/ColorPreview.tsx +2 -6
  58. package/src/components/color-picker/preview/color_config.ts +29 -0
  59. package/src/components/draggable/draggable.tsx +127 -0
  60. package/src/components/form/components/input/draggable_numeric_input.tsx +107 -0
  61. package/src/components/form/components/input/index.ts +1 -0
  62. package/src/components/form/components/input/numeric_input.tsx +2 -1
  63. package/src/components/form/components/input_groups/form_group.tsx +10 -3
  64. package/src/components/form/context/use_ts_form.ts +2 -0
  65. package/src/components/table/reorder_rows/draggable_row_tr.tsx +1 -1
  66. package/src/components/table/reorder_rows/use_drop_monitor.ts +1 -1
  67. package/src/components/utils/assert.ts +13 -0
  68. package/src/components/utils/svg.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"accordion_context_provider.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BA+D9D"}
1
+ {"version":3,"file":"accordion_context_provider.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BA+D9D"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { assert } from '@zakodium/utils';
2
3
  import { useMemo, useRef } from 'react';
3
- import { assert } from '../utils/index.js';
4
4
  import { accordionContext } from './accordion_context.js';
5
5
  import { getAccordionRegister } from './accordion_context_utils.js';
6
6
  export function AccordionProvider(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"accordion_context_provider.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3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BACT,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;YACD,UAAU,EAAE,CAAC,EAAU,EAAE,EAAE;gBACzB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC5B,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACjC,CAAC;YACD,QAAQ,EAAE,CAAC,EAAU,EAAE,SAAiC,EAAE,EAAE;gBAC1D,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,8BAA8B,EAAE,4EAA4E,CAC7G,CAAC;gBACJ,CAAC;gBACD,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAC1B,SAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,YAAY,GAAG,OAAO,CAAwB,GAAG,EAAE;QACvD,OAAO;YACL;gBACE,eAAe;aAChB;YACD,KAAK;SACN,CAAC;IACJ,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"accordion_context_provider.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion_context_provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGxC,O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,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;YACD,UAAU,EAAE,CAAC,EAAU,EAAE,EAAE;gBACzB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC5B,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACjC,CAAC;YACD,QAAQ,EAAE,CAAC,EAAU,EAAE,SAAiC,EAAE,EAAE;gBAC1D,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,8BAA8B,EAAE,4EAA4E,CAC7G,CAAC;gBACJ,CAAC;gBACD,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAC1B,SAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,YAAY,GAAG,OAAO,CAAwB,GAAG,EAAE;QACvD,OAAO;YACL;gBACE,eAAe;aAChB;YACD,KAAK;SACN,CAAC;IACJ,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC"}
@@ -3,4 +3,6 @@ export * from './gradient_select/index.js';
3
3
  export * from './preview/ColorPreview.js';
4
4
  export * from './react-color/ColorPicker.js';
5
5
  export * from './palette.js';
6
+ export { assertColorFixed, assertColorGradient, } from './preview/color_config.ts';
7
+ export type { ColorConfig } from './preview/color_config.ts';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
@@ -3,4 +3,5 @@ export * from './gradient_select/index.js';
3
3
  export * from './preview/ColorPreview.js';
4
4
  export * from './react-color/ColorPicker.js';
5
5
  export * from './palette.js';
6
+ export { assertColorFixed, assertColorGradient, } from "./preview/color_config.js";
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/color-picker/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/color-picker/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
@@ -1,11 +1,4 @@
1
- import type { GradientScaleName } from '../gradient_select/index.js';
2
- export type ColorConfig = {
3
- kind: 'fixed';
4
- color: string;
5
- } | {
6
- kind: 'fixedGradient';
7
- gradient: GradientScaleName;
8
- };
1
+ import type { ColorConfig } from './color_config.ts';
9
2
  export interface ColorPreviewProps {
10
3
  color: ColorConfig;
11
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPreview.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/preview/ColorPreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAKrE,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAYpD"}
1
+ {"version":3,"file":"ColorPreview.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/preview/ColorPreview.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAYpD"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { assertUnreachable } from '../../utils/assert.js';
2
+ import { assertUnreachable } from '@zakodium/utils';
3
3
  import FixedColorPreview from './FixedColorPreview.js';
4
4
  import FixedGradientPreview from './FixedGradientPreview.js';
5
5
  export function ColorPreview(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPreview.js","sourceRoot":"","sources":["../../../../src/components/color-picker/preview/ColorPreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAU7D,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,OAAO,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAAC;QACnD,CAAC;QACD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO,KAAC,oBAAoB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI,CAAC;QAC5D,CAAC;QACD;YACE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"ColorPreview.js","sourceRoot":"","sources":["../../../../src/components/color-picker/preview/ColorPreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAO7D,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,OAAO,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAAC;QACnD,CAAC;QACD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,OAAO,KAAC,oBAAoB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI,CAAC;QAC5D,CAAC;QACD;YACE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { GradientScaleName } from '../gradient_select/index.ts';
2
+ interface ColorConfigFixed {
3
+ kind: 'fixed';
4
+ color: string;
5
+ }
6
+ interface ColorConfigGradient {
7
+ kind: 'fixedGradient';
8
+ gradient: GradientScaleName;
9
+ }
10
+ export type ColorConfig = ColorConfigFixed | ColorConfigGradient;
11
+ export declare function assertColorFixed(color: ColorConfig): asserts color is ColorConfigFixed;
12
+ export declare function assertColorGradient(color: ColorConfig): asserts color is ColorConfigGradient;
13
+ export {};
14
+ //# sourceMappingURL=color_config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_config.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/preview/color_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,UAAU,gBAAgB;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEjE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,KAAK,IAAI,gBAAgB,CAInC;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,KAAK,IAAI,mBAAmB,CAItC"}
@@ -0,0 +1,11 @@
1
+ export function assertColorFixed(color) {
2
+ if (color.kind !== 'fixed') {
3
+ throw new Error('Only fixed colors are supported');
4
+ }
5
+ }
6
+ export function assertColorGradient(color) {
7
+ if (color.kind !== 'fixedGradient') {
8
+ throw new Error('Only fixed colors are supported');
9
+ }
10
+ }
11
+ //# sourceMappingURL=color_config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_config.js","sourceRoot":"","sources":["../../../../src/components/color-picker/preview/color_config.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,gBAAgB,CAC9B,KAAkB;IAElB,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAAkB;IAElB,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Intent } from '@blueprintjs/core';
2
+ import type { ReactNode } from 'react';
3
+ interface DraggableProps {
4
+ children: ReactNode;
5
+ value: number;
6
+ onChange: (_: number, value: string) => void;
7
+ onBlur: () => void;
8
+ step?: number;
9
+ min?: number;
10
+ max?: number;
11
+ intent: Intent;
12
+ majorStepSize?: number | null;
13
+ minorStepSize?: number | null;
14
+ className?: string;
15
+ }
16
+ export declare function Draggable(props: DraggableProps): import("react").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=draggable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draggable.d.ts","sourceRoot":"","sources":["../../../src/components/draggable/draggable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAItE,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BA+E9C"}
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Classes, Utils } from '@blueprintjs/core';
3
+ import styled from '@emotion/styled';
4
+ import { clamp } from '@zakodium/utils';
5
+ import { useCallback, useEffect, useRef } from 'react';
6
+ import { match } from 'ts-pattern';
7
+ const DraggableContainer = styled.div `
8
+ width: 100%;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ user-select: none;
13
+ cursor: ew-resize;
14
+ height: 100%;
15
+ min-height: 30px;
16
+ `;
17
+ const DraggableLabel = styled.span `
18
+ white-space: nowrap;
19
+ text-overflow: ellipsis;
20
+ overflow: hidden;
21
+ max-width: 100%;
22
+ padding-left: 5px;
23
+ padding-right: 5px;
24
+ `;
25
+ export function Draggable(props) {
26
+ const { children, value, onChange, onBlur, step: stepSize = 1, min, max, intent, majorStepSize, minorStepSize, className, } = props;
27
+ const draggedValueRef = useRef(value);
28
+ const onChangeRef = useRef(onChange);
29
+ const previousPositionRef = useRef(0);
30
+ const isDraggingRef = useRef(false);
31
+ useEffect(() => {
32
+ function handleMouseMove(event) {
33
+ if (!isDraggingRef.current)
34
+ return;
35
+ const diff = event.clientX - previousPositionRef.current;
36
+ previousPositionRef.current = event.clientX;
37
+ if (event.buttons === 1) {
38
+ const step = match(event)
39
+ .with({ shiftKey: true }, () => majorStepSize ?? stepSize)
40
+ .with({ altKey: true }, () => minorStepSize ?? stepSize)
41
+ .otherwise(() => stepSize);
42
+ const precision = Math.max(Utils.countDecimalPlaces(draggedValueRef.current), Utils.countDecimalPlaces(minorStepSize ?? stepSize));
43
+ const nextValue = toMaxPrecision(draggedValueRef.current + diff * step, precision);
44
+ draggedValueRef.current = clamp(nextValue, min, max);
45
+ onChangeRef.current(0, String(draggedValueRef.current));
46
+ }
47
+ }
48
+ function handleMouseUp() {
49
+ isDraggingRef.current = false;
50
+ onBlur();
51
+ }
52
+ window.addEventListener('mousemove', handleMouseMove);
53
+ window.addEventListener('mouseup', handleMouseUp);
54
+ return () => {
55
+ window.removeEventListener('mousemove', handleMouseMove);
56
+ window.removeEventListener('mouseup', handleMouseUp);
57
+ };
58
+ }, [majorStepSize, max, min, minorStepSize, onBlur, stepSize]);
59
+ const handleMouseDown = useCallback((event) => {
60
+ isDraggingRef.current = true;
61
+ previousPositionRef.current = event.clientX;
62
+ draggedValueRef.current = value;
63
+ }, [value]);
64
+ return (_jsx(DraggableContainer, { onMouseDown: handleMouseDown, className: `${className} ${Classes.TAG} ${Classes.MINIMAL} ${Classes.intentClass(intent)}`, children: _jsx(DraggableLabel, { children: children }) }));
65
+ }
66
+ function toMaxPrecision(value, maxPrecision) {
67
+ const scaleFactor = 10 ** maxPrecision;
68
+ return Math.round(value * scaleFactor) / scaleFactor;
69
+ }
70
+ //# sourceMappingURL=draggable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draggable.js","sourceRoot":"","sources":["../../../src/components/draggable/draggable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAgBnC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CASpC,CAA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AC,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,YAE1F,KAAC,cAAc,cAAE,QAAQ,GAAkB,GACxB,CACtB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAa,EAAE,YAAoB;IACzD,MAAM,WAAW,GAAG,EAAE,IAAI,YAAY,CAAC;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,WAAW,CAAC;AACvD,CAAC"}
@@ -20,6 +20,7 @@ export declare const FieldGroupSVGLineStyleFields: <TFormData, TFields extends i
20
20
  readonly Switch: typeof import("../input/switch.tsx").Switch;
21
21
  readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
22
22
  readonly RadioGroup: typeof import("../input/radio_group.tsx").RadioGroup;
23
+ readonly DraggableNumericInput: typeof import("../input/draggable_numeric_input.tsx").DraggableNumericInput;
23
24
  }, {
24
25
  readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
25
26
  readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
@@ -32,6 +33,7 @@ export declare const FieldGroupSVGLineStyleFields: <TFormData, TFields extends i
32
33
  readonly Switch: typeof import("../input/switch.tsx").Switch;
33
34
  readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
34
35
  readonly RadioGroup: typeof import("../input/radio_group.tsx").RadioGroup;
36
+ readonly DraggableNumericInput: typeof import("../input/draggable_numeric_input.tsx").DraggableNumericInput;
35
37
  }, {
36
38
  readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
37
39
  readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
@@ -1 +1 @@
1
- {"version":3,"file":"svg_line_style.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_line_style.tsx"],"names":[],"mappings":"AAuBA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAaD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAqCvC,CAAC"}
1
+ {"version":3,"file":"svg_line_style.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_line_style.tsx"],"names":[],"mappings":"AAuBA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAaD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAqCvC,CAAC"}
@@ -21,6 +21,7 @@ export declare const FieldGroupSVGTextStyleFields: <TFormData, TFields extends i
21
21
  readonly Switch: typeof import("../input/switch.tsx").Switch;
22
22
  readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
23
23
  readonly RadioGroup: typeof import("../input/radio_group.tsx").RadioGroup;
24
+ readonly DraggableNumericInput: typeof import("../input/draggable_numeric_input.tsx").DraggableNumericInput;
24
25
  }, {
25
26
  readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
26
27
  readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
@@ -33,6 +34,7 @@ export declare const FieldGroupSVGTextStyleFields: <TFormData, TFields extends i
33
34
  readonly Switch: typeof import("../input/switch.tsx").Switch;
34
35
  readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
35
36
  readonly RadioGroup: typeof import("../input/radio_group.tsx").RadioGroup;
37
+ readonly DraggableNumericInput: typeof import("../input/draggable_numeric_input.tsx").DraggableNumericInput;
36
38
  }, {
37
39
  readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
38
40
  readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
@@ -1 +1 @@
1
- {"version":3,"file":"svg_text_style.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_text_style.tsx"],"names":[],"mappings":"AAyBA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA4DvC,CAAC"}
1
+ {"version":3,"file":"svg_text_style.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_text_style.tsx"],"names":[],"mappings":"AAyBA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA4DvC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Intent } from '@blueprintjs/core';
2
+ import type { NumericInputProps } from './numeric_input.tsx';
3
+ interface DraggableNumericInputProps extends NumericInputProps {
4
+ draggableLabel: string;
5
+ draggableIntent?: Intent;
6
+ hideInput?: boolean;
7
+ }
8
+ export declare function DraggableNumericInput(props: DraggableNumericInputProps): import("react").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=draggable_numeric_input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draggable_numeric_input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/draggable_numeric_input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,0BAA2B,SAAQ,iBAAiB;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAYD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BA+EtE"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { NumericInput as BPNumericInput } from '@blueprintjs/core';
3
+ import styled from '@emotion/styled';
4
+ import { Draggable as InputDraggable } from "../../../draggable/draggable.js";
5
+ import { useFieldContext } from "../../context/use_ts_form.js";
6
+ import { getIntent } from "../../utils/use_intent.js";
7
+ import { FormGroup } from "../input_groups/index.js";
8
+ const DraggableNumericInputContainer = styled.div `
9
+ display: flex;
10
+ flex-direction: row;
11
+ gap: 5px;
12
+ `;
13
+ const Draggable = styled(InputDraggable) `
14
+ flex: 1;
15
+ `;
16
+ export function DraggableNumericInput(props) {
17
+ const { label, required, helpText, placeholder, step, min, max, layout, fullWidth, draggableLabel, draggableIntent = 'success', hideInput = false, majorStepSize, minorStepSize, ...otherProps } = props;
18
+ const field = useFieldContext();
19
+ const error = field
20
+ .getMeta()
21
+ .errors.map((e) => e.message)
22
+ .at(0);
23
+ const intent = getIntent(error);
24
+ function onChange(_, valueAsString) {
25
+ return field.handleChange(valueAsString);
26
+ }
27
+ return (_jsx(FormGroup, { name: field.name, label: label, intent: intent, required: required, helpText: helpText, layout: layout, error: undefined, fullWidth: fullWidth, contentFullWidth: true, children: _jsxs(DraggableNumericInputContainer, { children: [!hideInput && (_jsx(BPNumericInput, { ...otherProps, id: field.name, name: field.name, stepSize: step, min: min, max: max, majorStepSize: majorStepSize, minorStepSize: minorStepSize, value: field.state.value ?? '', onValueChange: onChange, onBlur: field.handleBlur, intent: intent, placeholder: placeholder, required: required })), _jsx(Draggable, { value: Number(field.state.value), onBlur: field.handleBlur, onChange: onChange, step: step, min: min, max: max, majorStepSize: majorStepSize, minorStepSize: minorStepSize, intent: draggableIntent, children: draggableLabel })] }) }));
28
+ }
29
+ //# sourceMappingURL=draggable_numeric_input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draggable_numeric_input.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input/draggable_numeric_input.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,SAAS,I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EhB,MAAC,8BAA8B,eAC5B,CAAC,SAAS,IAAI,CACb,KAAC,cAAc,OACT,UAAU,EACd,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,EAC9B,aAAa,EAAE,QAAQ,EACvB,MAAM,EAAE,KAAK,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,GAClB,CACH,EAED,KAAC,SAAS,IACR,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAChC,MAAM,EAAE,KAAK,CAAC,UAAU,EACxB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,eAAe,YAEtB,cAAc,GACL,IACmB,GACvB,CACb,CAAC;AACJ,CAAC"}
@@ -7,4 +7,5 @@ export type { ResetButton as _ResetButton } from './reset_button.js';
7
7
  export type { Select as _Select, SelectOptionType, SelectProps, } from './select.js';
8
8
  export type { SubmitButton as _SubmitButton } from './submit_button.js';
9
9
  export type { Switch as _Switch } from './switch.js';
10
+ export type { DraggableNumericInput as _DraggableNumericInput } from './draggable_numeric_input.js';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAC3D,YAAY,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,YAAY,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,YAAY,EACV,MAAM,IAAI,OAAO,EACjB,gBAAgB,EAChB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAC3D,YAAY,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,YAAY,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,YAAY,EACV,MAAM,IAAI,OAAO,EACjB,gBAAgB,EAChB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import type { NumericInputProps as BPNumericInputProps } from '@blueprintjs/core';
2
2
  import type { FormGroupInputProps } from '../input_groups/form_group.js';
3
- interface NumericInputProps extends FormGroupInputProps, BPNumericInputProps {
3
+ export interface NumericInputProps extends FormGroupInputProps, BPNumericInputProps {
4
4
  step?: number;
5
5
  min?: number;
6
6
  max?: number;
7
7
  autoFocus?: boolean;
8
8
  }
9
9
  export declare function NumericInput(props: NumericInputProps): import("react").JSX.Element;
10
- export {};
11
10
  //# sourceMappingURL=numeric_input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"numeric_input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/numeric_input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,IAAI,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAKlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,UAAU,iBAAkB,SAAQ,mBAAmB,EAAE,mBAAmB;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAqDpD"}
1
+ {"version":3,"file":"numeric_input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/numeric_input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,IAAI,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAKlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,MAAM,WAAW,iBACf,SAAQ,mBAAmB,EAAE,mBAAmB;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAqDpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"numeric_input.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input/numeric_input.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAU1D,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,MAAM,EACN,SAAS,EACT,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,eAAe,EAAU,CAAC;IACxC,MAAM,KAAK,GAAG,KAAK;SAChB,OAAO,EAAE;SACT,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SAC5B,EAAE,CAAC,CAAC,CAAC,CAAC;IAET,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEhC,SAAS,QAAQ,CAAC,CAAS,EAAE,aAAqB;QAChD,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IACR,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,YAEpB,KAAC,cAAc,OACT,UAAU,EACd,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,EAC9B,aAAa,EAAE,QAAQ,EACvB,MAAM,EAAE,KAAK,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,GAClB,GACQ,CACb,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"numeric_input.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input/numeric_input.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAW1D,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,MAAM,EACN,SAAS,EACT,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,eAAe,EAAU,CAAC;IACxC,MAAM,KAAK,GAAG,KAAK;SAChB,OAAO,EAAE;SACT,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SAC5B,EAAE,CAAC,CAAC,CAAC,CAAC;IAET,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEhC,SAAS,QAAQ,CAAC,CAAS,EAAE,aAAqB;QAChD,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IACR,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,YAEpB,KAAC,cAAc,OACT,UAAU,EACd,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,QAAQ,EAAE,IAAI,EACd,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,EAC9B,aAAa,EAAE,QAAQ,EACvB,MAAM,EAAE,KAAK,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,GAClB,GACQ,CACb,CAAC;AACJ,CAAC"}
@@ -19,6 +19,7 @@ interface FormGroupProps {
19
19
  error?: string;
20
20
  layout?: Layout;
21
21
  fullWidth?: boolean;
22
+ contentFullWidth?: boolean;
22
23
  }
23
24
  export declare function FormGroup(props: FormGroupProps): import("react").JSX.Element;
24
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"form_group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input_groups/form_group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA+DhD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAkD9C"}
1
+ {"version":3,"file":"form_group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input_groups/form_group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAgEhD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAuD9C"}
@@ -8,7 +8,7 @@ const FormContainer = styled.div `
8
8
  width: 100%;
9
9
  display: grid;
10
10
  margin: 0;
11
- grid-template-columns: ${(props) => props.layout === 'inline' ? '[label] 30% [input] 70%' : '1fr'};
11
+ grid-template-columns: ${(props) => props.layout === 'inline' ? '[label] 3fr [input] 7fr' : '1fr'};
12
12
  gap: 5px 20px;
13
13
  grid-template-rows: ${(props) => props.layout === 'inline' ? 'auto auto' : 'auto'};
14
14
  `;
@@ -23,7 +23,7 @@ const ContainerElement = styled.div `
23
23
  ? 'input'
24
24
  : '1 / -1'};
25
25
  height: ${(props) => props.height === 'auto' ? props.height : `${props.height}px`};
26
- width: fit-content;
26
+ width: ${(props) => (props.contentFullWidth ? '100%' : 'fit-content')};
27
27
  min-width: 180px;
28
28
  `;
29
29
  // Keep 26 px for inline layout to align with input height
@@ -45,10 +45,10 @@ const HelpText = styled(InfoText) `
45
45
  color: ${Colors.GRAY1} !important;
46
46
  `;
47
47
  export function FormGroup(props) {
48
- const { label, intent = 'none', name, required, children, helpText, error, layout, fullWidth = false, } = props;
48
+ const { label, intent = 'none', name, required, children, helpText, error, layout, fullWidth = false, contentFullWidth = false, } = props;
49
49
  const { layout: formLayout } = useFormContext();
50
50
  // If intent is undefined or none intentClass will return undefined
51
51
  const intentClass = Classes.intentClass(intent) ?? '';
52
- return (_jsxs(FormContainer, { layout: layout || formLayout, className: `${Classes.FORM_GROUP} ${intentClass}`, children: [label && (_jsxs(Label, { layout: layout || formLayout, className: Classes.LABEL, htmlFor: name, children: [label, ' ', required && (_jsx(RequiredSpan, { className: Classes.TEXT_MUTED, children: "*" }))] })), _jsxs(ContainerElement, { fullWidth: fullWidth, layout: layout || formLayout, children: [children, _jsxs(ErrorAndHelpText, { children: [helpText && (_jsx(HelpText, { className: Classes.FORM_HELPER_TEXT, children: helpText })), error && (_jsx(InfoText, { className: Classes.FORM_HELPER_TEXT, children: error }))] })] })] }));
52
+ return (_jsxs(FormContainer, { layout: layout || formLayout, className: `${Classes.FORM_GROUP} ${intentClass}`, children: [label && (_jsxs(Label, { layout: layout || formLayout, className: Classes.LABEL, htmlFor: name, children: [label, ' ', required && (_jsx(RequiredSpan, { className: Classes.TEXT_MUTED, children: "*" }))] })), _jsxs(ContainerElement, { fullWidth: fullWidth, layout: layout || formLayout, contentFullWidth: contentFullWidth, children: [children, _jsxs(ErrorAndHelpText, { children: [helpText && (_jsx(HelpText, { className: Classes.FORM_HELPER_TEXT, children: helpText })), error && (_jsx(InfoText, { className: Classes.FORM_HELPER_TEXT, children: error }))] })] })] }));
53
53
  }
54
54
  //# sourceMappingURL=form_group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form_group.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input_groups/form_group.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAE9B;gBACc,YAAY;;;;2BAID,CAAC,KAAK,EAAE,EAAE,CACjC,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK;;wBAEzC,CAAC,KAAK,EAAE,EAAE,CAC9B,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM;CACnD,CA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ClB,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,CAAC;IAEhD,mEAAmE;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAEtD,OAAO,CACL,MAAC,aAAa,IACZ,MAAM,EAAE,MAAM,IAAI,UAAU,EAC5B,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,IAAI,WAAW,EAAE,aAEhD,KAAK,IAAI,CACR,MAAC,KAAK,IACJ,MAAM,EAAE,MAAM,IAAI,UAAU,EAC5B,SAAS,EAAE,OAAO,CAAC,KAAK,EACxB,OAAO,EAAE,IAAI,aAEZ,KAAK,EAAE,GAAG,EACV,QAAQ,IAAI,CACX,KAAC,YAAY,IAAC,SAAS,EAAE,OAAO,CAAC,UAAU,kBAAkB,CAC9D,IACK,CACT,EACD,MAAC,gBAAgB,IAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,UAAU,aACjE,QAAQ,EAET,MAAC,gBAAgB,eACd,QAAQ,IAAI,CACX,KAAC,QAAQ,IAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,YAAG,QAAQ,GAAY,CACrE,EAEA,KAAK,IAAI,CACR,KAAC,QAAQ,IAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,YAAG,KAAK,GAAY,CAClE,IACgB,IACF,IACL,CACjB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"form_group.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input_groups/form_group.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG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AAI,CACR,KAAC,QAAQ,IAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,YAAG,KAAK,GAAY,CAClE,IACgB,IACF,IACL,CACjB,CAAC;AACJ,CAAC"}
@@ -30,6 +30,7 @@ export declare const AppForm: MinimalFunctionComponent<MinimalProps<import("reac
30
30
  readonly Switch: typeof import("../input/switch.tsx").Switch;
31
31
  readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
32
32
  readonly RadioGroup: typeof import("../input/radio_group.tsx").RadioGroup;
33
+ readonly DraggableNumericInput: typeof import("../input/draggable_numeric_input.tsx").DraggableNumericInput;
33
34
  }, {
34
35
  readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
35
36
  readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/layout/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGzE,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC;IACpE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IAGH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,eAAe,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC;IAE5E;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAWD;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;IAuCnB,CAAC;AAEF,KAAK,YAAY,CAAC,KAAK,SAAS;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG;IACzE;;OAEG;IACH,IAAI,EAAE,IAAI,CACR,KAAK,CAAC,MAAM,CAAC,EAKb,gBAAgB,GAAG,kBAAkB,GAAG,mBAAmB,CAC5D,CAAC;CACH,CAAC;AACF,KAAK,wBAAwB,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC"}
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/layout/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGzE,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC;IACpE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IAGH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,eAAe,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC;IAE5E;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAWD;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;IAuCnB,CAAC;AAEF,KAAK,YAAY,CAAC,KAAK,SAAS;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG;IACzE;;OAEG;IACH,IAAI,EAAE,IAAI,CACR,KAAK,CAAC,MAAM,CAAC,EAKb,gBAAgB,GAAG,kBAAkB,GAAG,mBAAmB,CAC5D,CAAC;CACH,CAAC;AACF,KAAK,wBAAwB,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { Checkbox } from '../components/input/checkbox.js';
2
2
  import { ColorPicker } from '../components/input/color_picker.tsx';
3
+ import { DraggableNumericInput } from '../components/input/draggable_numeric_input.js';
3
4
  import { Input } from '../components/input/input.js';
4
5
  import { NumericInput } from '../components/input/numeric_input.js';
5
6
  import { RadioGroup } from '../components/input/radio_group.js';
@@ -17,6 +18,7 @@ declare const withForm: <TFormData, TOnMount extends import("@tanstack/react-for
17
18
  readonly Switch: typeof Switch;
18
19
  readonly ColorPicker: typeof ColorPicker;
19
20
  readonly RadioGroup: typeof RadioGroup;
21
+ readonly DraggableNumericInput: typeof DraggableNumericInput;
20
22
  }, {
21
23
  readonly SubmitButton: typeof SubmitButton;
22
24
  readonly ResetButton: typeof ResetButton;
@@ -30,6 +32,7 @@ declare const withForm: <TFormData, TOnMount extends import("@tanstack/react-for
30
32
  readonly Switch: typeof Switch;
31
33
  readonly ColorPicker: typeof ColorPicker;
32
34
  readonly RadioGroup: typeof RadioGroup;
35
+ readonly DraggableNumericInput: typeof DraggableNumericInput;
33
36
  }, {
34
37
  readonly SubmitButton: typeof SubmitButton;
35
38
  readonly ResetButton: typeof ResetButton;
@@ -43,6 +46,7 @@ declare const withForm: <TFormData, TOnMount extends import("@tanstack/react-for
43
46
  readonly Switch: typeof Switch;
44
47
  readonly ColorPicker: typeof ColorPicker;
45
48
  readonly RadioGroup: typeof RadioGroup;
49
+ readonly DraggableNumericInput: typeof DraggableNumericInput;
46
50
  }, {
47
51
  readonly SubmitButton: typeof SubmitButton;
48
52
  readonly ResetButton: typeof ResetButton;
@@ -56,6 +60,7 @@ declare const withForm: <TFormData, TOnMount extends import("@tanstack/react-for
56
60
  readonly Switch: typeof Switch;
57
61
  readonly ColorPicker: typeof ColorPicker;
58
62
  readonly RadioGroup: typeof RadioGroup;
63
+ readonly DraggableNumericInput: typeof DraggableNumericInput;
59
64
  }, {
60
65
  readonly SubmitButton: typeof SubmitButton;
61
66
  readonly ResetButton: typeof ResetButton;
@@ -68,6 +73,7 @@ declare const withForm: <TFormData, TOnMount extends import("@tanstack/react-for
68
73
  readonly Switch: typeof Switch;
69
74
  readonly ColorPicker: typeof ColorPicker;
70
75
  readonly RadioGroup: typeof RadioGroup;
76
+ readonly DraggableNumericInput: typeof DraggableNumericInput;
71
77
  }, {
72
78
  readonly SubmitButton: typeof SubmitButton;
73
79
  readonly ResetButton: typeof ResetButton;
@@ -83,6 +89,7 @@ export declare const useForm: <TFormData, TOnMount extends import("@tanstack/rea
83
89
  readonly Switch: typeof Switch;
84
90
  readonly ColorPicker: typeof ColorPicker;
85
91
  readonly RadioGroup: typeof RadioGroup;
92
+ readonly DraggableNumericInput: typeof DraggableNumericInput;
86
93
  }, {
87
94
  readonly SubmitButton: typeof SubmitButton;
88
95
  readonly ResetButton: typeof ResetButton;
@@ -1 +1 @@
1
- {"version":3,"file":"use_ts_form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/context/use_ts_form.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,QAAA,MAAQ,cAAc,2IAAE,eAAe,8KACb,CAAC;AAS3B,QAAA,MAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;KAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAiB1C,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;EAAa,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"use_ts_form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/context/use_ts_form.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,QAAA,MAAQ,cAAc,2IAAE,eAAe,8KACb,CAAC;AAS3B,QAAA,MAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAkB1C,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;EAAa,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { createFormHook, createFormHookContexts } from '@tanstack/react-form';
2
2
  import { Checkbox } from '../components/input/checkbox.js';
3
3
  import { ColorPicker } from "../components/input/color_picker.js";
4
+ import { DraggableNumericInput } from '../components/input/draggable_numeric_input.js';
4
5
  import { Input } from '../components/input/input.js';
5
6
  import { NumericInput } from '../components/input/numeric_input.js';
6
7
  import { RadioGroup } from '../components/input/radio_group.js';
@@ -33,6 +34,7 @@ const { useAppForm, withForm, withFieldGroup } = createFormHook({
33
34
  Switch,
34
35
  ColorPicker,
35
36
  RadioGroup,
37
+ DraggableNumericInput,
36
38
  },
37
39
  });
38
40
  export const useForm = useAppForm;
@@ -1 +1 @@
1
- {"version":3,"file":"use_ts_form.js","sourceRoot":"","sources":["../../../../src/components/form/context/use_ts_form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAsC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,GAClE,sBAAsB,EAAE,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,cAAc,CAAC;IAC9D,YAAY;IACZ,WAAW;IACX,cAAc,EAAE;QACd,YAAY;QACZ,WAAW;QACX,OAAO;KACR;IACD,eAAe,EAAE;QACf,KAAK;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,MAAM;QACN,WAAW;QACX,UAAU;KACX;CACF,CAA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C,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { attachClosestEdge, combine, draggable, dropTargetForElements, extractClosestEdge, pointerOutsideOfPreview, setCustomNativeDragPreview, } from '@zakodium/pdnd-esm';
3
+ import { assert } from '@zakodium/utils';
3
4
  import { useEffect, useMemo, useRef, useState } from 'react';
4
5
  import { createPortal } from 'react-dom';
5
- import { assert } from '../../utils/index.js';
6
6
  import { useFlashRowEffect } from '../flash_row/use_flash_row_effect.js';
7
7
  import { PreviewTable } from '../preview_table.js';
8
8
  import { useIsPreviewTable } from '../preview_table_context.js';
@@ -1 +1 @@
1
- {"version":3,"file":"draggable_row_tr.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/draggable_row_tr.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAOhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBA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,CAAC,CAAC;YACtB,CAAC;YACD,MAAM;gBACJ,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtB,CAAC;SACF,CAAC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAEjC,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAEvC,MAAM,KAAK,GAAG,OAAO,CAAsB,GAAG,EAAE;QAC9C,OAAO;YACL,aAAa;YACb,KAAK;SACN,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,8BACE,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACxC,gBAAQ,OAAO,EAAE,GAAG,EAAE,WAAW,GAAI,GACR,EAC9B,KAAK,CAAC,IAAI,KAAK,SAAS;gBACvB,YAAY,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IACrD,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACvD,MAAM,aAAa,GAAuB,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"draggable_row_tr.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/draggable_row_tr.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EA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I,KAAK,SAAS;wBAC1B,OAAO,CAAC,WAAW,KAAK,WAAW,EACnC,CAAC;wBACD,OAAO,OAAO,CAAC;oBACjB,CAAC;oBACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;gBAC1C,CAAC,CAAC,CAAC;YACL,CAAC;YACD,WAAW;gBACT,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtB,CAAC;YACD,MAAM;gBACJ,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtB,CAAC;SACF,CAAC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAEjC,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAEvC,MAAM,KAAK,GAAG,OAAO,CAAsB,GAAG,EAAE;QAC9C,OAAO;YACL,aAAa;YACb,KAAK;SACN,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,8BACE,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACxC,gBAAQ,OAAO,EAAE,GAAG,EAAE,WAAW,GAAI,GACR,EAC9B,KAAK,CAAC,IAAI,KAAK,SAAS;gBACvB,YAAY,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IACrD,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACvD,MAAM,aAAa,GAAuB,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use_drop_monitor.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC3C,OAAO,EAAE,OAAO,QAsDjB"}
1
+ {"version":3,"file":"use_drop_monitor.d.ts","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC3C,OAAO,EAAE,OAAO,QAsDjB"}
@@ -1,6 +1,6 @@
1
1
  import { autoScrollForElements, combine, extractClosestEdge, monitorForElements, } from '@zakodium/pdnd-esm';
2
+ import { assert } from '@zakodium/utils';
2
3
  import { useEffect } from 'react';
3
- import { assert } from '../../utils/index.js';
4
4
  import { useFlashedRowContext } from '../flash_row/flashed_row_context.js';
5
5
  import { isItemData } from './item_data.js';
6
6
  import { useItemOrder } from './item_order_context.js';
@@ -1 +1 @@
1
- {"version":3,"file":"use_drop_monitor.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,gBAA2C,EAC3C,OAAgB;IAEhB,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAC9C,MAAM,CA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C;YAC/B,CAAC;SACF,CAAC,EACF,qBAAqB,CAAC;YACpB,SAAS,EAAE,UAAU;YACrB,OAAO,EAAE,eAAe;SACzB,CAAC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"}
1
+ {"version":3,"file":"use_drop_monitor.js","sourceRoot":"","sources":["../../../../src/components/table/reorder_rows/use_drop_monitor.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,gBAA2C,EAC3C,OAAgB;IAEhB,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAC9C,MAAM,CAAC,EAAE,aAAa,CAAC,GAAG,oBAAoB,EAAE,CAAC;IACjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,gBAAgB,CAAC,OAAO,CAAC;QACjD,MAAM,CAAC,eAAe,EAAE,8BAA8B,CAAC,CAAC;QAExD,SAAS,UAAU,CAAC,EAAE,MAAM,EAAkC;YAC5D,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,OAAO,CACZ,kBAAkB,CAAC;YACjB,UAAU,EAAE,UAAU;YACtB,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,OAAO;gBACT,CAAC;gBAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;gBAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;gBAC/B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;oBACvD,OAAO;gBACT,CAAC;gBAED,MAAM,aAAa,GAAG,KAAK,CAAC,SAAS,CACnC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,CACpC,CAAC;gBACF,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;oBACzB,OAAO;gBACT,CAAC;gBAED,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;gBAE3D,WAAW,CAAC;oBACV,UAAU,EAAE,UAAU,CAAC,KAAK;oBAC5B,aAAa;oBACb,mBAAmB;iBACpB,CAAC,CAAC;gBACH,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAC/B,CAAC;SACF,CAAC,EACF,qBAAqB,CAAC;YACpB,SAAS,EAAE,UAAU;YACrB,OAAO,EAAE,eAAe;SACzB,CAAC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -1,4 +1,17 @@
1
+ /**
2
+ * @param x
3
+ * @deprecated Use `assertUnreachable` from `@zakodium/utils`
4
+ */
1
5
  export declare function assertUnreachable(x: never): never;
6
+ /**
7
+ * @param x
8
+ * @deprecated Use `assertNotNullish` from `@zakodium/utils`
9
+ */
2
10
  export declare function assertNotNull<T>(value: T | null | undefined): asserts value is Exclude<T, null | undefined>;
11
+ /**
12
+ * @param value
13
+ * @param message
14
+ * @deprecated Use `assert` from `@zakodium/utils`
15
+ */
3
16
  export declare function assert(value: unknown, message?: string): asserts value;
4
17
  //# sourceMappingURL=assert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/components/utils/assert.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAEjD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1B,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAO/C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAItE"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/components/utils/assert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAEjD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1B,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAO/C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAItE"}
@@ -1,6 +1,14 @@
1
+ /**
2
+ * @param x
3
+ * @deprecated Use `assertUnreachable` from `@zakodium/utils`
4
+ */
1
5
  export function assertUnreachable(x) {
2
6
  throw new Error(`unreachable: ${String(x)}`);
3
7
  }
8
+ /**
9
+ * @param x
10
+ * @deprecated Use `assertNotNullish` from `@zakodium/utils`
11
+ */
4
12
  export function assertNotNull(value) {
5
13
  if (value === null) {
6
14
  throw new Error('unexpected null value');
@@ -9,6 +17,11 @@ export function assertNotNull(value) {
9
17
  throw new Error('unexpected undefined value');
10
18
  }
11
19
  }
20
+ /**
21
+ * @param value
22
+ * @param message
23
+ * @deprecated Use `assert` from `@zakodium/utils`
24
+ */
12
25
  export function assert(value, message) {
13
26
  if (!value) {
14
27
  throw new Error(`unreachable${message ? `: ${message}` : ''}`);
@@ -1 +1 @@
1
- {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/components/utils/assert.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,CAAQ;IACxC,MAAM,IAAI,KAAK,CAAC,gBAAgB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,KAA2B;IAE3B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,OAAgB;IACrD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,cAAc,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/components/utils/assert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAQ;IACxC,MAAM,IAAI,KAAK,CAAC,gBAAgB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,KAA2B;IAE3B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,OAAgB;IACrD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,cAAc,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { assert } from "./assert.js";
1
+ import { assert } from '@zakodium/utils';
2
2
  /**
3
3
  * Export an SVG element to a string.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/components/utils/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA+BrC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAmB,EACnB,UAA4B,EAAE;IAE9B,MAAM,EACJ,kBAAkB,EAClB,aAAa,GAAG,KAAK,EACrB,eAAe,GAAG,OAAO,EACzB,eAAe,GAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAkB,CAAC;IAElD,cAAc;IACd,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QACvD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CA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OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEZ,IAAI,aAAa,EAAE,CAAC;QAClB,GAAG,CAAC,SAAS,GAAG,eAAe,CAAC;QAChC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEzB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9D,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-science",
3
- "version": "20.5.0",
3
+ "version": "20.6.0",
4
4
  "description": "React components to build scientific applications UI",
5
5
  "type": "module",
6
6
  "exports": {
@@ -63,6 +63,7 @@
63
63
  "@tanstack/react-table": "^8.21.3",
64
64
  "@tanstack/react-virtual": "^3.14.6",
65
65
  "@zakodium/pdnd-esm": "^1.1.0",
66
+ "@zakodium/utils": "^0.4.1",
66
67
  "d3-scale-chromatic": "^3.1.0",
67
68
  "react-d3-utils": "^3.1.2",
68
69
  "react-dropzone": "^17.0.0",
@@ -1,8 +1,7 @@
1
+ import { assert } from '@zakodium/utils';
1
2
  import type { ReactNode } from 'react';
2
3
  import { useMemo, useRef } from 'react';
3
4
 
4
- import { assert } from '../utils/index.js';
5
-
6
5
  import type { AccordionContextValue } from './accordion_context.js';
7
6
  import { accordionContext } from './accordion_context.js';
8
7
  import type { AccordionItemSetIsOpen } from './accordion_context_utils.js';
@@ -3,3 +3,8 @@ export * from './gradient_select/index.js';
3
3
  export * from './preview/ColorPreview.js';
4
4
  export * from './react-color/ColorPicker.js';
5
5
  export * from './palette.js';
6
+ export {
7
+ assertColorFixed,
8
+ assertColorGradient,
9
+ } from './preview/color_config.ts';
10
+ export type { ColorConfig } from './preview/color_config.ts';
@@ -1,12 +1,8 @@
1
- import { assertUnreachable } from '../../utils/assert.js';
2
- import type { GradientScaleName } from '../gradient_select/index.js';
1
+ import { assertUnreachable } from '@zakodium/utils';
3
2
 
4
3
  import FixedColorPreview from './FixedColorPreview.js';
5
4
  import FixedGradientPreview from './FixedGradientPreview.js';
6
-
7
- export type ColorConfig =
8
- | { kind: 'fixed'; color: string }
9
- | { kind: 'fixedGradient'; gradient: GradientScaleName };
5
+ import type { ColorConfig } from './color_config.ts';
10
6
 
11
7
  export interface ColorPreviewProps {
12
8
  color: ColorConfig;
@@ -0,0 +1,29 @@
1
+ import type { GradientScaleName } from '../gradient_select/index.ts';
2
+
3
+ interface ColorConfigFixed {
4
+ kind: 'fixed';
5
+ color: string;
6
+ }
7
+
8
+ interface ColorConfigGradient {
9
+ kind: 'fixedGradient';
10
+ gradient: GradientScaleName;
11
+ }
12
+
13
+ export type ColorConfig = ColorConfigFixed | ColorConfigGradient;
14
+
15
+ export function assertColorFixed(
16
+ color: ColorConfig,
17
+ ): asserts color is ColorConfigFixed {
18
+ if (color.kind !== 'fixed') {
19
+ throw new Error('Only fixed colors are supported');
20
+ }
21
+ }
22
+
23
+ export function assertColorGradient(
24
+ color: ColorConfig,
25
+ ): asserts color is ColorConfigGradient {
26
+ if (color.kind !== 'fixedGradient') {
27
+ throw new Error('Only fixed colors are supported');
28
+ }
29
+ }
@@ -0,0 +1,127 @@
1
+ import type { Intent } from '@blueprintjs/core';
2
+ import { Classes, Utils } from '@blueprintjs/core';
3
+ import styled from '@emotion/styled';
4
+ import { clamp } from '@zakodium/utils';
5
+ import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
6
+ import { useCallback, useEffect, useRef } from 'react';
7
+ import { match } from 'ts-pattern';
8
+
9
+ interface DraggableProps {
10
+ children: ReactNode;
11
+ value: number;
12
+ onChange: (_: number, value: string) => void;
13
+ onBlur: () => void;
14
+ step?: number;
15
+ min?: number;
16
+ max?: number;
17
+ intent: Intent;
18
+ majorStepSize?: number | null;
19
+ minorStepSize?: number | null;
20
+ className?: string;
21
+ }
22
+
23
+ const DraggableContainer = styled.div`
24
+ width: 100%;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ user-select: none;
29
+ cursor: ew-resize;
30
+ height: 100%;
31
+ min-height: 30px;
32
+ `;
33
+
34
+ const DraggableLabel = styled.span`
35
+ white-space: nowrap;
36
+ text-overflow: ellipsis;
37
+ overflow: hidden;
38
+ max-width: 100%;
39
+ padding-left: 5px;
40
+ padding-right: 5px;
41
+ `;
42
+
43
+ export function Draggable(props: DraggableProps) {
44
+ const {
45
+ children,
46
+ value,
47
+ onChange,
48
+ onBlur,
49
+ step: stepSize = 1,
50
+ min,
51
+ max,
52
+ intent,
53
+ majorStepSize,
54
+ minorStepSize,
55
+ className,
56
+ } = props;
57
+
58
+ const draggedValueRef = useRef(value);
59
+ const onChangeRef = useRef(onChange);
60
+ const previousPositionRef = useRef<number>(0);
61
+ const isDraggingRef = useRef<boolean>(false);
62
+
63
+ useEffect(() => {
64
+ function handleMouseMove(event: MouseEvent) {
65
+ if (!isDraggingRef.current) return;
66
+
67
+ const diff = event.clientX - previousPositionRef.current;
68
+ previousPositionRef.current = event.clientX;
69
+
70
+ if (event.buttons === 1) {
71
+ const step = match(event)
72
+ .with({ shiftKey: true }, () => majorStepSize ?? stepSize)
73
+ .with({ altKey: true }, () => minorStepSize ?? stepSize)
74
+ .otherwise(() => stepSize);
75
+
76
+ const precision = Math.max(
77
+ Utils.countDecimalPlaces(draggedValueRef.current),
78
+ Utils.countDecimalPlaces(minorStepSize ?? stepSize),
79
+ );
80
+
81
+ const nextValue = toMaxPrecision(
82
+ draggedValueRef.current + diff * step,
83
+ precision,
84
+ );
85
+
86
+ draggedValueRef.current = clamp(nextValue, min, max);
87
+ onChangeRef.current(0, String(draggedValueRef.current));
88
+ }
89
+ }
90
+
91
+ function handleMouseUp() {
92
+ isDraggingRef.current = false;
93
+ onBlur();
94
+ }
95
+
96
+ window.addEventListener('mousemove', handleMouseMove);
97
+ window.addEventListener('mouseup', handleMouseUp);
98
+
99
+ return () => {
100
+ window.removeEventListener('mousemove', handleMouseMove);
101
+ window.removeEventListener('mouseup', handleMouseUp);
102
+ };
103
+ }, [majorStepSize, max, min, minorStepSize, onBlur, stepSize]);
104
+
105
+ const handleMouseDown = useCallback(
106
+ (event: ReactMouseEvent) => {
107
+ isDraggingRef.current = true;
108
+ previousPositionRef.current = event.clientX;
109
+ draggedValueRef.current = value;
110
+ },
111
+ [value],
112
+ );
113
+
114
+ return (
115
+ <DraggableContainer
116
+ onMouseDown={handleMouseDown}
117
+ className={`${className} ${Classes.TAG} ${Classes.MINIMAL} ${Classes.intentClass(intent)}`}
118
+ >
119
+ <DraggableLabel>{children}</DraggableLabel>
120
+ </DraggableContainer>
121
+ );
122
+ }
123
+
124
+ function toMaxPrecision(value: number, maxPrecision: number) {
125
+ const scaleFactor = 10 ** maxPrecision;
126
+ return Math.round(value * scaleFactor) / scaleFactor;
127
+ }
@@ -0,0 +1,107 @@
1
+ import type { Intent } from '@blueprintjs/core';
2
+ import { NumericInput as BPNumericInput } from '@blueprintjs/core';
3
+ import styled from '@emotion/styled';
4
+
5
+ import { Draggable as InputDraggable } from '../../../draggable/draggable.tsx';
6
+ import { useFieldContext } from '../../context/use_ts_form.ts';
7
+ import { getIntent } from '../../utils/use_intent.ts';
8
+ import { FormGroup } from '../input_groups/index.ts';
9
+
10
+ import type { NumericInputProps } from './numeric_input.tsx';
11
+
12
+ interface DraggableNumericInputProps extends NumericInputProps {
13
+ draggableLabel: string;
14
+ draggableIntent?: Intent;
15
+ hideInput?: boolean;
16
+ }
17
+
18
+ const DraggableNumericInputContainer = styled.div`
19
+ display: flex;
20
+ flex-direction: row;
21
+ gap: 5px;
22
+ `;
23
+
24
+ const Draggable = styled(InputDraggable)`
25
+ flex: 1;
26
+ `;
27
+
28
+ export function DraggableNumericInput(props: DraggableNumericInputProps) {
29
+ const {
30
+ label,
31
+ required,
32
+ helpText,
33
+ placeholder,
34
+ step,
35
+ min,
36
+ max,
37
+ layout,
38
+ fullWidth,
39
+ draggableLabel,
40
+ draggableIntent = 'success',
41
+ hideInput = false,
42
+ majorStepSize,
43
+ minorStepSize,
44
+ ...otherProps
45
+ } = props;
46
+
47
+ const field = useFieldContext<string>();
48
+ const error = field
49
+ .getMeta()
50
+ .errors.map((e) => e.message)
51
+ .at(0);
52
+
53
+ const intent = getIntent(error);
54
+
55
+ function onChange(_: number, valueAsString: string) {
56
+ return field.handleChange(valueAsString);
57
+ }
58
+
59
+ return (
60
+ <FormGroup
61
+ name={field.name}
62
+ label={label}
63
+ intent={intent}
64
+ required={required}
65
+ helpText={helpText}
66
+ layout={layout}
67
+ error={undefined}
68
+ fullWidth={fullWidth}
69
+ contentFullWidth
70
+ >
71
+ <DraggableNumericInputContainer>
72
+ {!hideInput && (
73
+ <BPNumericInput
74
+ {...otherProps}
75
+ id={field.name}
76
+ name={field.name}
77
+ stepSize={step}
78
+ min={min}
79
+ max={max}
80
+ majorStepSize={majorStepSize}
81
+ minorStepSize={minorStepSize}
82
+ value={field.state.value ?? ''}
83
+ onValueChange={onChange}
84
+ onBlur={field.handleBlur}
85
+ intent={intent}
86
+ placeholder={placeholder}
87
+ required={required}
88
+ />
89
+ )}
90
+
91
+ <Draggable
92
+ value={Number(field.state.value)}
93
+ onBlur={field.handleBlur}
94
+ onChange={onChange}
95
+ step={step}
96
+ min={min}
97
+ max={max}
98
+ majorStepSize={majorStepSize}
99
+ minorStepSize={minorStepSize}
100
+ intent={draggableIntent}
101
+ >
102
+ {draggableLabel}
103
+ </Draggable>
104
+ </DraggableNumericInputContainer>
105
+ </FormGroup>
106
+ );
107
+ }
@@ -11,3 +11,4 @@ export type {
11
11
  } from './select.js';
12
12
  export type { SubmitButton as _SubmitButton } from './submit_button.js';
13
13
  export type { Switch as _Switch } from './switch.js';
14
+ export type { DraggableNumericInput as _DraggableNumericInput } from './draggable_numeric_input.js';
@@ -6,7 +6,8 @@ import { getIntent } from '../../utils/use_intent.js';
6
6
  import type { FormGroupInputProps } from '../input_groups/form_group.js';
7
7
  import { FormGroup } from '../input_groups/form_group.js';
8
8
 
9
- interface NumericInputProps extends FormGroupInputProps, BPNumericInputProps {
9
+ export interface NumericInputProps
10
+ extends FormGroupInputProps, BPNumericInputProps {
10
11
  step?: number;
11
12
  min?: number;
12
13
  max?: number;
@@ -16,7 +16,7 @@ const FormContainer = styled.div<{
16
16
  display: grid;
17
17
  margin: 0;
18
18
  grid-template-columns: ${(props) =>
19
- props.layout === 'inline' ? '[label] 30% [input] 70%' : '1fr'};
19
+ props.layout === 'inline' ? '[label] 3fr [input] 7fr' : '1fr'};
20
20
  gap: 5px 20px;
21
21
  grid-template-rows: ${(props) =>
22
22
  props.layout === 'inline' ? 'auto auto' : 'auto'};
@@ -29,6 +29,7 @@ const RequiredSpan = styled.span`
29
29
  const ContainerElement = styled.div<{
30
30
  height?: number | 'auto';
31
31
  fullWidth?: boolean;
32
+ contentFullWidth?: boolean;
32
33
  layout?: Layout;
33
34
  }>`
34
35
  display: inline-block;
@@ -40,7 +41,7 @@ const ContainerElement = styled.div<{
40
41
  : '1 / -1'};
41
42
  height: ${(props) =>
42
43
  props.height === 'auto' ? props.height : `${props.height}px`};
43
- width: fit-content;
44
+ width: ${(props) => (props.contentFullWidth ? '100%' : 'fit-content')};
44
45
  min-width: 180px;
45
46
  `;
46
47
 
@@ -85,6 +86,7 @@ interface FormGroupProps {
85
86
  error?: string;
86
87
  layout?: Layout;
87
88
  fullWidth?: boolean;
89
+ contentFullWidth?: boolean;
88
90
  }
89
91
 
90
92
  export function FormGroup(props: FormGroupProps) {
@@ -98,6 +100,7 @@ export function FormGroup(props: FormGroupProps) {
98
100
  error,
99
101
  layout,
100
102
  fullWidth = false,
103
+ contentFullWidth = false,
101
104
  } = props;
102
105
 
103
106
  const { layout: formLayout } = useFormContext();
@@ -122,7 +125,11 @@ export function FormGroup(props: FormGroupProps) {
122
125
  )}
123
126
  </Label>
124
127
  )}
125
- <ContainerElement fullWidth={fullWidth} layout={layout || formLayout}>
128
+ <ContainerElement
129
+ fullWidth={fullWidth}
130
+ layout={layout || formLayout}
131
+ contentFullWidth={contentFullWidth}
132
+ >
126
133
  {children}
127
134
 
128
135
  <ErrorAndHelpText>
@@ -2,6 +2,7 @@ import { createFormHook, createFormHookContexts } from '@tanstack/react-form';
2
2
 
3
3
  import { Checkbox } from '../components/input/checkbox.js';
4
4
  import { ColorPicker } from '../components/input/color_picker.tsx';
5
+ import { DraggableNumericInput } from '../components/input/draggable_numeric_input.js';
5
6
  import { Input } from '../components/input/input.js';
6
7
  import { NumericInput } from '../components/input/numeric_input.js';
7
8
  import { RadioGroup } from '../components/input/radio_group.js';
@@ -37,6 +38,7 @@ const { useAppForm, withForm, withFieldGroup } = createFormHook({
37
38
  Switch,
38
39
  ColorPicker,
39
40
  RadioGroup,
41
+ DraggableNumericInput,
40
42
  },
41
43
  });
42
44
 
@@ -9,10 +9,10 @@ import {
9
9
  pointerOutsideOfPreview,
10
10
  setCustomNativeDragPreview,
11
11
  } from '@zakodium/pdnd-esm';
12
+ import { assert } from '@zakodium/utils';
12
13
  import { useEffect, useMemo, useRef, useState } from 'react';
13
14
  import { createPortal } from 'react-dom';
14
15
 
15
- import { assert } from '../../utils/index.js';
16
16
  import { useFlashRowEffect } from '../flash_row/use_flash_row_effect.js';
17
17
  import { PreviewTable } from '../preview_table.js';
18
18
  import { useIsPreviewTable } from '../preview_table_context.js';
@@ -5,10 +5,10 @@ import {
5
5
  extractClosestEdge,
6
6
  monitorForElements,
7
7
  } from '@zakodium/pdnd-esm';
8
+ import { assert } from '@zakodium/utils';
8
9
  import type { RefObject } from 'react';
9
10
  import { useEffect } from 'react';
10
11
 
11
- import { assert } from '../../utils/index.js';
12
12
  import { useFlashedRowContext } from '../flash_row/flashed_row_context.js';
13
13
 
14
14
  import { isItemData } from './item_data.js';
@@ -1,7 +1,15 @@
1
+ /**
2
+ * @param x
3
+ * @deprecated Use `assertUnreachable` from `@zakodium/utils`
4
+ */
1
5
  export function assertUnreachable(x: never): never {
2
6
  throw new Error(`unreachable: ${String(x)}`);
3
7
  }
4
8
 
9
+ /**
10
+ * @param x
11
+ * @deprecated Use `assertNotNullish` from `@zakodium/utils`
12
+ */
5
13
  export function assertNotNull<T>(
6
14
  value: T | null | undefined,
7
15
  ): asserts value is Exclude<T, null | undefined> {
@@ -13,6 +21,11 @@ export function assertNotNull<T>(
13
21
  }
14
22
  }
15
23
 
24
+ /**
25
+ * @param value
26
+ * @param message
27
+ * @deprecated Use `assert` from `@zakodium/utils`
28
+ */
16
29
  export function assert(value: unknown, message?: string): asserts value {
17
30
  if (!value) {
18
31
  throw new Error(`unreachable${message ? `: ${message}` : ''}`);
@@ -1,4 +1,4 @@
1
- import { assert } from './assert.ts';
1
+ import { assert } from '@zakodium/utils';
2
2
 
3
3
  export interface ExportSVGOptions {
4
4
  /**