@nascentdigital/funnel-editor 4.5.2 → 4.5.4

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 (70) hide show
  1. package/dist/EditorApp.js +1 -1
  2. package/dist/core/components/ColorModeToggle.d.ts +2 -2
  3. package/dist/core/components/feedback/Note.d.ts +3 -1
  4. package/dist/core/components/feedback/Note.js +6 -3
  5. package/dist/core/components/fields/BooleanField.d.ts +3 -1
  6. package/dist/core/components/fields/BooleanField.js +2 -2
  7. package/dist/core/components/fields/DateField.d.ts +3 -1
  8. package/dist/core/components/fields/DateField.js +2 -2
  9. package/dist/core/components/fields/EnumField.d.ts +3 -1
  10. package/dist/core/components/fields/EnumField.js +4 -4
  11. package/dist/core/components/fields/FieldEditor.d.ts +3 -1
  12. package/dist/core/components/fields/FieldEditor.js +7 -7
  13. package/dist/core/components/fields/FieldHeader.d.ts +3 -1
  14. package/dist/core/components/fields/FieldHeader.js +18 -5
  15. package/dist/core/components/fields/FieldLayout.d.ts +3 -1
  16. package/dist/core/components/fields/FieldLayout.js +17 -4
  17. package/dist/core/components/fields/FieldSize.d.ts +1 -0
  18. package/dist/core/components/fields/FieldSize.js +2 -0
  19. package/dist/core/components/fields/FieldsPanel.js +5 -4
  20. package/dist/core/components/fields/RichTextEditor.d.ts +2 -3
  21. package/dist/core/components/fields/RichTextEditor.js +13 -10
  22. package/dist/core/components/fields/RichTextField.d.ts +1 -2
  23. package/dist/core/components/fields/RichTextField.js +4 -16
  24. package/dist/core/components/fields/TextField.d.ts +3 -2
  25. package/dist/core/components/fields/TextField.js +8 -7
  26. package/dist/core/components/fields/TimestampField.d.ts +3 -1
  27. package/dist/core/components/fields/TimestampField.js +2 -2
  28. package/dist/core/components/fields/collection/CollectionPicker.js +3 -4
  29. package/dist/core/components/fields/index.d.ts +2 -0
  30. package/dist/core/components/fields/index.js +2 -0
  31. package/dist/core/components/fields/page/PagePicker.js +2 -3
  32. package/dist/core/components/fields/richtext/Theme.d.ts +1 -2
  33. package/dist/core/components/fields/richtext/Theme.js +2 -2
  34. package/dist/core/components/interaction/Animate.d.ts +1 -1
  35. package/dist/core/components/interaction/Animate.js +12 -2
  36. package/dist/core/components/interaction/Button.js +3 -3
  37. package/dist/core/components/interaction/Combobox.d.ts +8 -1
  38. package/dist/core/components/interaction/Combobox.js +39 -12
  39. package/dist/core/components/interaction/IconButton.d.ts +2 -2
  40. package/dist/core/components/interaction/IconButton.js +2 -1
  41. package/dist/core/components/interaction/QuickEditor.d.ts +11 -0
  42. package/dist/core/components/interaction/QuickEditor.js +33 -0
  43. package/dist/core/components/interaction/QuickInput.js +1 -1
  44. package/dist/core/components/interaction/QuickPicker.js +5 -3
  45. package/dist/core/components/interaction/SegmentedButton.d.ts +3 -1
  46. package/dist/core/components/interaction/SegmentedButton.js +4 -1
  47. package/dist/core/components/interaction/SideSheet.d.ts +5 -5
  48. package/dist/core/components/interaction/SideSheet.js +15 -43
  49. package/dist/core/components/interaction/centersheet/CenterSheet.js +1 -1
  50. package/dist/core/components/interaction/centersheet/CenterSheetContainer.js +1 -1
  51. package/dist/core/components/interaction/index.d.ts +1 -0
  52. package/dist/core/components/interaction/index.js +1 -0
  53. package/dist/core/components/visuals/Icon.d.ts +2 -2
  54. package/dist/core/components/visuals/Icon.js +5 -0
  55. package/dist/core/domain/BlockConfiguration.d.ts +16 -1
  56. package/dist/core/domain/BlockConfiguration.js +109 -5
  57. package/dist/page/components/config/BlockConfig.js +1 -1
  58. package/dist/page/components/config/BlockConfigEditor.d.ts +1 -1
  59. package/dist/page/components/config/BlockConfigEditor.js +40 -13
  60. package/dist/page/components/config/BlockPreview.js +23 -17
  61. package/dist/page/components/config/LegacyBlockConfigEditor.js +1 -9
  62. package/dist/page/components/config/ListPanelEditor.d.ts +4 -2
  63. package/dist/page/components/config/ListPanelEditor.js +52 -2
  64. package/dist/page/components/config/MessagePanelEditor.d.ts +4 -2
  65. package/dist/page/components/config/MessagePanelEditor.js +6 -2
  66. package/dist/page/components/config/VisualPanelEditor.d.ts +4 -2
  67. package/dist/page/components/config/VisualPanelEditor.js +65 -2
  68. package/dist/styles/index.css +367 -193
  69. package/dist/styles/tailwind.js +11 -16
  70. package/package.json +2 -2
package/dist/EditorApp.js CHANGED
@@ -36,5 +36,5 @@ function EditorApp({ fonts }) {
36
36
  return null;
37
37
  }
38
38
  // render
39
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('Editor-wrap', ...fonts), children: (0, jsx_runtime_1.jsx)(core_1.AppStateContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SettingsContainer, { children: (0, jsx_runtime_1.jsx)(react_hotkeys_hook_1.HotkeysProvider, { children: (0, jsx_runtime_1.jsx)(core_1.EditorApiContainer, { children: (0, jsx_runtime_1.jsx)(core_1.AuthContainer, { children: (0, jsx_runtime_1.jsx)(client_1.BreakpointContainer, { children: (0, jsx_runtime_1.jsx)(client_1.BackdropContainer, { children: (0, jsx_runtime_1.jsx)(core_1.DialogContainer, { children: (0, jsx_runtime_1.jsx)(core_1.CenterSheetContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SplashContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SiteConfigContainer, { children: (0, jsx_runtime_1.jsx)(EditorRoutes_1.EditorRoutes, {}) }) }) }) }) }) }) }) }) }) }) }) }));
39
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('Editor-wrap', ...fonts), children: (0, jsx_runtime_1.jsx)(core_1.AppStateContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SettingsContainer, { children: (0, jsx_runtime_1.jsx)(react_hotkeys_hook_1.HotkeysProvider, { children: (0, jsx_runtime_1.jsx)(core_1.EditorApiContainer, { children: (0, jsx_runtime_1.jsx)(core_1.AuthContainer, { children: (0, jsx_runtime_1.jsx)(client_1.BreakpointContainer, { breakpoints: { xs: 0, sm: 480, md: 768, lg: 980, xl: 1200 }, children: (0, jsx_runtime_1.jsx)(core_1.DialogContainer, { children: (0, jsx_runtime_1.jsx)(core_1.CenterSheetContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SplashContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SiteConfigContainer, { children: (0, jsx_runtime_1.jsx)(EditorRoutes_1.EditorRoutes, {}) }) }) }) }) }) }) }) }) }) }) }));
40
40
  }
@@ -1,8 +1,8 @@
1
- import { Popup } from '@nascentdigital/funnel-ui/client';
1
+ import { Placement } from '@nascentdigital/funnel-core';
2
2
  export declare function ColorModeToggle({ className, popupPlacement }: ColorModeToggle.Props): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace ColorModeToggle {
4
4
  type Props = {
5
5
  className?: string;
6
- popupPlacement?: Popup.Placement;
6
+ popupPlacement?: Placement;
7
7
  };
8
8
  }
@@ -1,9 +1,11 @@
1
1
  import { PropsWithChildren } from 'react';
2
- export declare function Note({ className, variant, children }: Note.Props): import("react/jsx-runtime").JSX.Element;
2
+ import { FieldSize } from '../fields';
3
+ export declare function Note({ className, variant, size, children }: Note.Props): import("react/jsx-runtime").JSX.Element;
3
4
  export declare namespace Note {
4
5
  type Props = PropsWithChildren & {
5
6
  className?: string;
6
7
  variant: Variant;
8
+ size?: FieldSize;
7
9
  };
8
10
  type Variant = 'tip' | 'info' | 'success' | 'error' | 'warn';
9
11
  }
@@ -9,9 +9,12 @@ const funnel_ui_1 = require("@nascentdigital/funnel-ui");
9
9
  const classnames_1 = __importDefault(require("classnames"));
10
10
  const visuals_1 = require("../visuals");
11
11
  // component
12
- function Note({ className, variant, children }) {
12
+ function Note({ className, variant, size = 'md', children }) {
13
13
  // render
14
- return ((0, jsx_runtime_1.jsxs)("p", { className: (0, classnames_1.default)(className, 'flex flex-row gap-l4 items-center', 'body-sm p-l6 border border-solid rounded-md', {
14
+ return ((0, jsx_runtime_1.jsxs)("p", { className: (0, classnames_1.default)(className, 'flex flex-row gap-l4 items-center', 'p-l6 border border-solid rounded-md', {
15
+ 'label-sm': size === 'md',
16
+ 'label-xs': size === 'sm',
17
+ 'label-xxs': size === 'xs',
15
18
  'text-info-content bg-info/tint0 border-info-content': variant === 'tip',
16
19
  'text-draft-content bg-draft/tint0 border-draft-content': variant === 'info',
17
20
  'text-success-content bg-success/tint0 border-success-content': variant === 'success',
@@ -25,7 +28,7 @@ function Note({ className, variant, children }) {
25
28
  ? 'CircleCheckBig'
26
29
  : variant === 'error'
27
30
  ? 'CircleAlert'
28
- : 'TriangleAlert' }), typeof children === 'string'
31
+ : 'TriangleAlert', size: size }), typeof children === 'string'
29
32
  ?
30
33
  (0, jsx_runtime_1.jsx)(funnel_ui_1.Markup, { markdown: children })
31
34
  : children] }));
@@ -1,10 +1,12 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
2
  import { FieldLayout } from './FieldLayout';
3
- export declare function BooleanField({ className, field, variant }: BooleanField.Props): import("react/jsx-runtime").JSX.Element;
3
+ import { FieldSize } from './FieldSize';
4
+ export declare function BooleanField({ className, field, variant, size }: BooleanField.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace BooleanField {
5
6
  type Props = {
6
7
  className?: string;
7
8
  field: Field<Schema.BooleanField>;
8
9
  variant?: FieldLayout.Variant;
10
+ size?: FieldSize;
9
11
  };
10
12
  }
@@ -7,7 +7,7 @@ const hooks_1 = require("../../hooks");
7
7
  const interaction_1 = require("../interaction");
8
8
  const FieldLayout_1 = require("./FieldLayout");
9
9
  // component
10
- function BooleanField({ className, field, variant = 'minimal' }) {
10
+ function BooleanField({ className, field, variant = 'minimal', size = 'md' }) {
11
11
  // bind toolbar
12
12
  const { id, name, value: data, schema } = field;
13
13
  const value = funnel_core_1.Schema.BooleanField.Value.fromData(data);
@@ -25,5 +25,5 @@ function BooleanField({ className, field, variant = 'minimal' }) {
25
25
  break;
26
26
  }
27
27
  // render
28
- return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: variant, children: component }));
28
+ return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: variant, size: size, children: component }));
29
29
  }
@@ -1,10 +1,12 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
2
  import { FieldLayout } from './FieldLayout';
3
- export declare function DateField({ className, field, variant }: DateField.Props): import("react/jsx-runtime").JSX.Element;
3
+ import { FieldSize } from './FieldSize';
4
+ export declare function DateField({ className, field, variant, size }: DateField.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace DateField {
5
6
  type Props = {
6
7
  className?: string;
7
8
  field: Field<Schema.DateField>;
8
9
  variant?: FieldLayout.Variant;
10
+ size?: FieldSize;
9
11
  };
10
12
  }
@@ -7,12 +7,12 @@ const hooks_1 = require("../../hooks");
7
7
  const interaction_1 = require("../interaction");
8
8
  const FieldLayout_1 = require("./FieldLayout");
9
9
  // component
10
- function DateField({ className, field, variant }) {
10
+ function DateField({ className, field, variant, size = 'md' }) {
11
11
  // bind toolbar
12
12
  const { id, name, value: data, schema } = field;
13
13
  const value = funnel_core_1.Schema.DateField.Value.fromData(data);
14
14
  // sync field
15
15
  (0, hooks_1.useField)(field);
16
16
  // render
17
- return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: variant, children: (0, jsx_runtime_1.jsx)(interaction_1.DatePicker, { minDate: schema.minDate, maxDate: schema.maxDate, selected: value, onChange: value => field.value = value && funnel_core_1.Schema.DateField.Value.toData(value) }) }));
17
+ return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: variant, size: size, children: (0, jsx_runtime_1.jsx)(interaction_1.DatePicker, { minDate: schema.minDate, maxDate: schema.maxDate, selected: value, onChange: value => field.value = value && funnel_core_1.Schema.DateField.Value.toData(value) }) }));
18
18
  }
@@ -1,11 +1,13 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
2
  import { FieldLayout } from './FieldLayout';
3
- export declare function EnumField({ className, field, variant, disabled }: EnumField.Props): import("react/jsx-runtime").JSX.Element;
3
+ import { FieldSize } from './FieldSize';
4
+ export declare function EnumField({ className, field, variant, size, disabled }: EnumField.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace EnumField {
5
6
  type Props = {
6
7
  className?: string;
7
8
  field: Field<Schema.EnumField>;
8
9
  variant?: FieldLayout.Variant;
10
+ size?: FieldSize;
9
11
  disabled?: boolean;
10
12
  };
11
13
  }
@@ -11,7 +11,7 @@ const hooks_1 = require("../../hooks");
11
11
  const interaction_1 = require("../interaction");
12
12
  const FieldLayout_1 = require("./FieldLayout");
13
13
  // component
14
- function EnumField({ className, field, variant, disabled }) {
14
+ function EnumField({ className, field, variant, size = 'md', disabled }) {
15
15
  // bind toolbar
16
16
  const { id, value: data, schema } = field;
17
17
  const value = funnel_core_1.Schema.EnumField.Value.fromData(data);
@@ -21,16 +21,16 @@ function EnumField({ className, field, variant, disabled }) {
21
21
  let picker;
22
22
  switch (schema.semantics) {
23
23
  case 'dropdown':
24
- picker = ((0, jsx_runtime_1.jsx)(interaction_1.Combobox, { className: "w-full", id: id, options: getComboboxOptions(schema), selectedOption: value !== null && value !== void 0 ? value : schema.defaultOption, onSelect: value => field.value = funnel_core_1.Schema.EnumField.Value.toData(value), disabled: disabled }));
24
+ picker = ((0, jsx_runtime_1.jsx)(interaction_1.Combobox, { className: "w-full", id: id, size: size, options: getComboboxOptions(schema), selectedOption: value !== null && value !== void 0 ? value : schema.defaultOption, onSelect: value => field.value = funnel_core_1.Schema.EnumField.Value.toData(value), disabled: disabled }));
25
25
  break;
26
26
  case 'segmented':
27
- picker = ((0, jsx_runtime_1.jsx)(interaction_1.SegmentedButton, { options: getSegmentedButtonOptions(schema), selected: value !== null && value !== void 0 ? value : schema.defaultOption, onSelectionChange: ([value]) => field.value = funnel_core_1.Schema.EnumField.Value.toData(value), disabled: disabled }));
27
+ picker = ((0, jsx_runtime_1.jsx)(interaction_1.SegmentedButton, { size: size, options: getSegmentedButtonOptions(schema), selected: value !== null && value !== void 0 ? value : schema.defaultOption, onSelectionChange: ([value]) => field.value = funnel_core_1.Schema.EnumField.Value.toData(value), disabled: disabled }));
28
28
  break;
29
29
  default:
30
30
  throw new funnel_core_1.NotImplementedError('No support for EnumField with "radio" semantics');
31
31
  }
32
32
  // render
33
- return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: (0, classnames_1.default)(className, 'w-full'), field: field, variant: variant, children: picker }));
33
+ return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: (0, classnames_1.default)(className, 'w-full'), field: field, variant: variant, size: size, children: picker }));
34
34
  }
35
35
  // helper
36
36
  function getComboboxOptions(schema) {
@@ -1,11 +1,13 @@
1
1
  import { Callback, FieldModel } from '@nascentdigital/funnel-core';
2
2
  import { FieldLayout } from './FieldLayout';
3
- export declare function FieldEditor({ className, field, variant, standalone, autoFocus: autoFocusRaw, disabled, secured, onValidChanged }: FieldEditor.Props): import("react/jsx-runtime").JSX.Element;
3
+ import { FieldSize } from './FieldSize';
4
+ export declare function FieldEditor({ className, field, variant, size, standalone, autoFocus: autoFocusRaw, disabled, secured, onValidChanged }: FieldEditor.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace FieldEditor {
5
6
  type Props = {
6
7
  className?: string;
7
8
  field: FieldModel;
8
9
  variant?: FieldLayout.Variant;
10
+ size?: FieldSize;
9
11
  standalone?: boolean;
10
12
  autoFocus?: boolean;
11
13
  secured?: boolean;
@@ -17,7 +17,7 @@ const RichTextField_1 = require("./RichTextField");
17
17
  const TextField_1 = require("./TextField");
18
18
  const TimestampField_1 = require("./TimestampField");
19
19
  // component
20
- function FieldEditor({ className, field, variant, standalone = false, autoFocus: autoFocusRaw = false, disabled = false, secured = false, onValidChanged = funnel_core_1.Fn.NoOp }) {
20
+ function FieldEditor({ className, field, variant, size = 'md', standalone = false, autoFocus: autoFocusRaw = false, disabled = false, secured = false, onValidChanged = funnel_core_1.Fn.NoOp }) {
21
21
  // bind state + hooks
22
22
  const wasValidRef = (0, react_1.useRef)(field.valid);
23
23
  const dialog = (0, feedback_1.useDialog)();
@@ -61,17 +61,17 @@ function FieldEditor({ className, field, variant, standalone = false, autoFocus:
61
61
  if (field instanceof funnel_core_1.Field) {
62
62
  switch (schema.type) {
63
63
  case 'text':
64
- return ((0, jsx_runtime_1.jsx)(TextField_1.TextField, { className: className, field: field, variant: variant, autoFocus: autoFocus, disabled: disabled, secured: secured }));
64
+ return ((0, jsx_runtime_1.jsx)(TextField_1.TextField, { className: className, field: field, size: size, variant: variant, autoFocus: autoFocus, disabled: disabled, secured: secured }));
65
65
  case 'richtext':
66
- return ((0, jsx_runtime_1.jsx)(RichTextField_1.RichTextField, { className: className, field: field, standalone: standalone, autoFocus: autoFocus, disabled: disabled }));
66
+ return ((0, jsx_runtime_1.jsx)(RichTextField_1.RichTextField, { className: className, field: field, autoFocus: autoFocus, disabled: disabled }));
67
67
  case 'enum':
68
- return ((0, jsx_runtime_1.jsx)(EnumField_1.EnumField, { className: className, field: field, variant: variant, disabled: disabled }));
68
+ return ((0, jsx_runtime_1.jsx)(EnumField_1.EnumField, { className: className, field: field, size: size, variant: variant, disabled: disabled }));
69
69
  case 'boolean':
70
- return ((0, jsx_runtime_1.jsx)(BooleanField_1.BooleanField, { className: className, field: field, variant: variant }));
70
+ return ((0, jsx_runtime_1.jsx)(BooleanField_1.BooleanField, { className: className, field: field, size: size, variant: variant }));
71
71
  case 'date':
72
- return ((0, jsx_runtime_1.jsx)(DateField_1.DateField, { className: className, field: field, variant: variant }));
72
+ return ((0, jsx_runtime_1.jsx)(DateField_1.DateField, { className: className, field: field, size: size, variant: variant }));
73
73
  case 'timestamp':
74
- return ((0, jsx_runtime_1.jsx)(TimestampField_1.TimestampField, { className: className, field: field, variant: variant, autoFocus: autoFocus, disabled: disabled, secured: secured }));
74
+ return ((0, jsx_runtime_1.jsx)(TimestampField_1.TimestampField, { className: className, field: field, size: size, variant: variant, autoFocus: autoFocus, disabled: disabled, secured: secured }));
75
75
  case 'link':
76
76
  case 'asset':
77
77
  case 'embedded.video':
@@ -1,8 +1,10 @@
1
1
  import { Callback } from '@nascentdigital/funnel-core';
2
- export declare function FieldHeader({ className, fieldId, label, tip, embedded, active: fieldActive, onDelete }: FieldHeader.Props): import("react/jsx-runtime").JSX.Element;
2
+ import { FieldSize } from './FieldSize';
3
+ export declare function FieldHeader({ className, size, fieldId, label, tip, embedded, active: fieldActive, onDelete }: FieldHeader.Props): import("react/jsx-runtime").JSX.Element;
3
4
  export declare namespace FieldHeader {
4
5
  type Props = {
5
6
  className?: string;
7
+ size?: FieldSize;
6
8
  fieldId?: string;
7
9
  label?: string;
8
10
  tip?: string;
@@ -12,7 +12,7 @@ const interaction_1 = require("../interaction");
12
12
  const visuals_1 = require("../visuals");
13
13
  const rxjs_1 = require("rxjs");
14
14
  // component
15
- function FieldHeader({ className, fieldId, label, tip, embedded = false, active: fieldActive = false, onDelete }) {
15
+ function FieldHeader({ className, size = 'md', fieldId, label, tip, embedded = false, active: fieldActive = false, onDelete }) {
16
16
  // bind hooks
17
17
  const [tipAnchor, setTipAnchor] = (0, react_1.useState)();
18
18
  const [focused, setFocused] = (0, react_1.useState)(false);
@@ -47,16 +47,29 @@ function FieldHeader({ className, fieldId, label, tip, embedded = false, active:
47
47
  }
48
48
  }, [fieldActive, focused]);
49
49
  // render
50
- const labelClassName = 'shrink-0 flex-1 label-md';
51
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(className, 'h-24 flex items-center gap-l2', 'text-content-primary'), children: [fieldId && !embedded
50
+ const labelClassName = (0, classnames_1.default)('shrink-0 flex-1', {
51
+ 'label-md': size === 'md',
52
+ 'label-xs': size === 'sm',
53
+ 'label-xxs': size === 'xs'
54
+ });
55
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(className, 'flex items-center text-content-secondary gap-l2', {
56
+ 'h-32': size === 'md',
57
+ 'h-20': size !== 'md'
58
+ }), children: [fieldId && !embedded
52
59
  ? (0, jsx_runtime_1.jsx)("label", { className: labelClassName, htmlFor: fieldId, children: label })
53
60
  : (0, jsx_runtime_1.jsx)("span", { className: labelClassName, children: embedded ? '' : label }), tip && !embedded &&
54
61
  (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: (0, classnames_1.default)({
55
62
  'opacity-none pointer-events-none interpolate-fast': !active,
56
63
  'opacity-full pointer-events-auto interpolate': active
57
- }), onPointerEnter: e => setTipAnchor(e.currentTarget), onPointerLeave: () => setTipAnchor(undefined), children: (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: "Info", size: "sm" }) }), (0, jsx_runtime_1.jsx)(interaction_1.Popup, { className: (0, classnames_1.default)('max-w-[200px] bg-surface2 rounded-sm px-l5 py-l4 pointer-events-none', 'border border-solid border-border-l1 shadow-tooltip'), open: !!tipAnchor, anchor: tipAnchor, anchorOffset: 4, placement: "top", disableOverlay: true, onClose: () => setTipAnchor(undefined), children: (0, jsx_runtime_1.jsx)(funnel_ui_1.Markup, { className: "block body-sm text-content-primary text-pretty", markdown: tip }) })] }), onDelete &&
64
+ }), onPointerEnter: e => setTipAnchor(e.currentTarget), onPointerLeave: () => setTipAnchor(undefined), children: (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: "Info", size: size === 'md' ? 'sm' : 'xs' }) }), (0, jsx_runtime_1.jsx)(interaction_1.Popup, { className: (0, classnames_1.default)('max-w-[200px] bg-surface2 pointer-events-none', 'border border-solid border-border-l1 rounded-sm shadow-tooltip', {
65
+ 'px-l5 py-l4': size === 'md',
66
+ 'px-l4 py-l3': size !== 'md'
67
+ }), open: !!tipAnchor, anchor: tipAnchor, anchorOffset: 4, placement: "top", disableOverlay: true, onClose: () => setTipAnchor(undefined), children: (0, jsx_runtime_1.jsx)(funnel_ui_1.Markup, { className: (0, classnames_1.default)('block text-content-primary text-pretty', {
68
+ 'body-sm': size === 'md',
69
+ 'body-xs': size !== 'md'
70
+ }), markdown: tip }) })] }), onDelete &&
58
71
  (0, jsx_runtime_1.jsx)(interaction_1.IconButton, { className: (0, classnames_1.default)({
59
72
  'opacity-none pointer-events-none interpolate-fast': !active,
60
73
  'opacity-full pointer-events-auto interpolate': active
61
- }), size: "xs", icon: "X", disabled: !active, onFocus: () => setFocused(true), onBlur: () => setFocused(false), onClick: () => onDelete() })] }));
74
+ }), icon: "X", size: size === 'md' ? 'xs' : 'xxs', disabled: !active, onFocus: () => setFocused(true), onBlur: () => setFocused(false), onClick: () => onDelete() })] }));
62
75
  }
@@ -1,11 +1,13 @@
1
1
  import { Callback, Field } from '@nascentdigital/funnel-core';
2
2
  import { ReactNode } from 'react';
3
- export declare function FieldLayout({ field, className, label: rawLabel, variant, onActiveChanged, children }: FieldLayout.Props): import("react/jsx-runtime").JSX.Element;
3
+ import { FieldSize } from './FieldSize';
4
+ export declare function FieldLayout({ field, className, label: rawLabel, variant, size, onActiveChanged, children }: FieldLayout.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace FieldLayout {
5
6
  type Variant = 'default' | 'wide' | 'minimal';
6
7
  type Props = {
7
8
  field?: Field;
8
9
  variant?: Variant;
10
+ size?: FieldSize;
9
11
  className?: string;
10
12
  label?: string;
11
13
  secured?: boolean;
@@ -14,7 +14,7 @@ const FieldErrorController_1 = require("./FieldErrorController");
14
14
  const FieldHeader_1 = require("./FieldHeader");
15
15
  const classnames_1 = __importDefault(require("classnames"));
16
16
  // component
17
- function FieldLayout({ field, className, label: rawLabel, variant = 'default', onActiveChanged = funnel_core_1.Fn.NoOp, children }) {
17
+ function FieldLayout({ field, className, label: rawLabel, variant = 'default', size = 'md', onActiveChanged = funnel_core_1.Fn.NoOp, children }) {
18
18
  var _a;
19
19
  // bind props + hook
20
20
  const { schema, name = 'Unknown', canOptOut = false } = field !== null && field !== void 0 ? field : {};
@@ -53,9 +53,22 @@ function FieldLayout({ field, className, label: rawLabel, variant = 'default', o
53
53
  };
54
54
  // render
55
55
  return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(className, {
56
- 'flex flex-col gap-m2': variant !== 'wide',
56
+ 'flex flex-col gap-l2': variant !== 'wide',
57
57
  'grid grid-cols-subgrid items-center': variant === 'wide'
58
58
  }), onPointerEnter: onActive, onPointerLeave: onInactive, children: [!minimal &&
59
- (0, jsx_runtime_1.jsx)(FieldHeader_1.FieldHeader, { fieldId: field === null || field === void 0 ? void 0 : field.id, label: label, tip: description, active: active || (field === null || field === void 0 ? void 0 : field.editing) === true, onDelete: canOptOut ? onOptOut : undefined }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-[200px]", children: [children, !minimal && hasErrors &&
60
- (0, jsx_runtime_1.jsx)("ul", { className: "flex flex-col gap-l2 mt-l3", "aria-live": "polite", children: errors.map((error, index) => (0, jsx_runtime_1.jsxs)("li", { className: "flex items-center gap-l2 text-destructive", children: [(0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: "TriangleAlert", size: "sm" }), (0, jsx_runtime_1.jsx)("span", { className: "label-sm ellipsis", children: error.message })] }, `error_${index}`)) })] })] }));
59
+ (0, jsx_runtime_1.jsx)(FieldHeader_1.FieldHeader, { fieldId: field === null || field === void 0 ? void 0 : field.id, size: size, label: label, tip: description, active: active || (field === null || field === void 0 ? void 0 : field.editing) === true, onDelete: canOptOut ? onOptOut : undefined }), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)({
60
+ 'min-w-[200px]': size === 'md',
61
+ 'min-w-[180px]': size !== 'sm',
62
+ 'min-w-[120px]': size !== 'xs'
63
+ }), children: [children, !minimal && hasErrors &&
64
+ (0, jsx_runtime_1.jsx)("ul", { className: (0, classnames_1.default)('flex flex-col', {
65
+ 'gap-l2 mt-l3': size === 'md',
66
+ 'gap-l1 mt-l2': size !== 'md'
67
+ }), "aria-live": "polite", children: errors.map((error, index) => (0, jsx_runtime_1.jsxs)("li", { className: (0, classnames_1.default)('flex items-center text-destructive', {
68
+ 'gap-l2': size === 'md',
69
+ 'gap-l1': size !== 'md'
70
+ }), children: [(0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: "TriangleAlert", size: size === 'md' ? 'sm' : 'xxs' }), (0, jsx_runtime_1.jsx)("span", { className: (0, classnames_1.default)('ellipsis', {
71
+ 'label-sm': size === 'md',
72
+ 'label-xxs': size !== 'md'
73
+ }), children: error.message })] }, `error_${index}`)) })] })] }));
61
74
  }
@@ -0,0 +1 @@
1
+ export type FieldSize = 'md' | 'sm' | 'xs';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -22,7 +22,7 @@ function FieldsPanel({ className, title, actions, fields, autoFocus = false }) {
22
22
  case 'opt-in':
23
23
  return ((0, jsx_runtime_1.jsx)("section", { className: (0, classnames_1.default)('', 'flex flex-wrap items-center gap-l8'), children: fields.map(field => (0, jsx_runtime_1.jsx)(OptInField_1.OptInField, { field: field }, field.id)) }, id));
24
24
  case 'input':
25
- return ((0, jsx_runtime_1.jsx)("section", { className: "flex flex-wrap items-center gap-l6", children: fields.map((field, fieldIndex) => (0, jsx_runtime_1.jsx)("div", { className: "w-full @fieldPanel2:w-[440px] flex justify-start", children: (0, jsx_runtime_1.jsx)(FieldEditor_1.FieldEditor, { field: field, autoFocus: autoFocus && groupIndex === 0 && fieldIndex === 0 }) }, field.id)) }, id));
25
+ return ((0, jsx_runtime_1.jsx)("section", { className: "flex flex-wrap items-center gap-l6", children: fields.map((field, fieldIndex) => (0, jsx_runtime_1.jsx)("div", { className: "w-full @fieldPanel2:w-[440px] flex justify-start", children: (0, jsx_runtime_1.jsx)(FieldEditor_1.FieldEditor, { className: "max-w-full", field: field, autoFocus: autoFocus && groupIndex === 0 && fieldIndex === 0 }) }, field.id)) }, id));
26
26
  case 'card':
27
27
  return ((0, jsx_runtime_1.jsx)("section", { className: "flex flex-wrap items-center gap-l6", children: fields.map((field, fieldIndex) => (0, jsx_runtime_1.jsx)(FieldEditor_1.FieldEditor, { field: field }, field.id)) }, id));
28
28
  case 'editor-sm':
@@ -55,11 +55,12 @@ function groupFields(fields) {
55
55
  groupType = 'input';
56
56
  break;
57
57
  case 'richtext':
58
- switch (field.schema.size) {
59
- case 'sm':
58
+ switch (field.schema.semantics) {
59
+ case 'field':
60
60
  groupType = 'input';
61
61
  break;
62
- case 'md':
62
+ case 'area':
63
+ case 'mini-editor':
63
64
  groupType = 'editor-sm';
64
65
  break;
65
66
  default:
@@ -1,15 +1,14 @@
1
1
  import { Callback, Schema } from '@nascentdigital/funnel-core';
2
- export declare function RichTextEditor({ id, variant, className, placeholder, required, disabled, autoFocus, standalone, richText, options: optionsRaw, onChange, onFocus, onBlur }: RichTextEditor.Props): import("react/jsx-runtime").JSX.Element;
2
+ export declare function RichTextEditor({ id, variant, className, placeholder, required, disabled, autoFocus, richText, options: optionsRaw, onChange, onFocus, onBlur }: RichTextEditor.Props): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace RichTextEditor {
4
4
  type Props = {
5
5
  id?: string;
6
- variant?: Variant;
6
+ variant?: Schema.RichTextField.Semantics;
7
7
  className?: string;
8
8
  placeholder?: string;
9
9
  required?: boolean;
10
10
  disabled?: boolean;
11
11
  autoFocus?: boolean;
12
- standalone?: boolean;
13
12
  richText?: Schema.RichTextField.Value;
14
13
  options?: Partial<Schema.RichTextField.Capabilities.Options>;
15
14
  onChange?: Callback<ChangeEvent>;
@@ -38,7 +38,7 @@ const lexical_1 = require("lexical");
38
38
  const react_1 = require("react");
39
39
  const richtext_1 = require("./richtext");
40
40
  // component
41
- function RichTextEditor({ id, variant = 'area', className, placeholder = DEFAULT_PLACEHOLDER, required = false, disabled = false, autoFocus = false, standalone = false, richText, options: optionsRaw, onChange = funnel_core_1.Fn.NoOp, onFocus = funnel_core_1.Fn.NoOp, onBlur = funnel_core_1.Fn.NoOp }) {
41
+ function RichTextEditor({ id, variant = 'area', className, placeholder = DEFAULT_PLACEHOLDER, required = false, disabled = false, autoFocus = false, richText, options: optionsRaw, onChange = funnel_core_1.Fn.NoOp, onFocus = funnel_core_1.Fn.NoOp, onBlur = funnel_core_1.Fn.NoOp }) {
42
42
  // sync change callback/ref
43
43
  const latestRawOptions = (0, client_1.useLatestValue)(optionsRaw !== null && optionsRaw !== void 0 ? optionsRaw : {});
44
44
  const options = (0, react_1.useMemo)(() => funnel_core_1.Schema.RichTextField.Capabilities.parse(latestRawOptions), [latestRawOptions]);
@@ -160,21 +160,24 @@ function RichTextEditor({ id, variant = 'area', className, placeholder = DEFAULT
160
160
  // render
161
161
  const isField = variant === 'field';
162
162
  const isArea = variant === 'area';
163
- const isEditor = variant === 'editor';
163
+ const isMiniEditor = variant === 'mini-editor';
164
+ const isFullEditor = variant === 'full-editor';
165
+ const isFixed = isMiniEditor || isFullEditor;
164
166
  return ((0, jsx_runtime_1.jsx)(LexicalComposer_1.LexicalComposer, { initialConfig: editorConfig, children: (0, jsx_runtime_1.jsxs)("div", { id: id, className: (0, classnames_1.default)(className, {
165
- 'h-full max-h-full grid grid-rows-[min-content_1fr] gap-l8 overflow-hidden': standalone,
166
- 'p-l8 border border-solid border-border-l1 rounded-lg': standalone,
167
- }), children: [isEditor
167
+ 'h-full max-h-full grid grid-rows-[min-content_1fr] gap-l6 p-l6 overflow-hidden': isFixed,
168
+ 'border border-solid border-border-l1 rounded-lg': isFixed
169
+ }), children: [isFixed
168
170
  ? (0, jsx_runtime_1.jsx)(richtext_1.Toolbar, { options: options })
169
171
  : (0, jsx_runtime_1.jsx)(richtext_1.FloatingToolbarPlugin, { options: options }), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('group relative', {
170
172
  'p-l5 overflow-y-scroll appearance-none scrollbar-thin': !isField,
171
173
  'field focus-within:field-focused rounded-lg': isArea,
172
174
  'h-[80px] max-h-[80px]': isArea,
173
- 'h-[400px] max-h-[400px]': isEditor && !standalone,
174
- 'h-full max-h-ful overflow-y-scroll scrollbar-thin cursor-text interpolate': standalone,
175
- 'bg-surface1 outline outline-1 outline-border-l1 rounded-lg': standalone,
176
- 'hover:outline-ix-primary/[.35] focus-within:outline-ix-primary hover:focus-within:outline-ix-primary': standalone,
177
- 'focus-within:ring-2 focus-within:ring-ix-primary/[0.35] focus-within:ring-offset-1': standalone
175
+ 'h-[120px] max-h-[120px]': isMiniEditor,
176
+ 'h-[400px] max-h-[400px]': isFullEditor,
177
+ 'max-h-full overflow-y-scroll scrollbar-thin cursor-text interpolate': isFixed,
178
+ 'bg-surface2 outline outline-1 outline-border-l1 rounded-md': isFixed,
179
+ 'hover:outline-ix-primary/[.35] focus-within:outline-ix-primary hover:focus-within:outline-ix-primary': isFixed,
180
+ 'focus-within:ring-2 focus-within:ring-ix-primary/[0.35] focus-within:ring-offset-1': isFixed
178
181
  }), children: [(0, jsx_runtime_1.jsx)(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: (0, jsx_runtime_1.jsx)(LexicalContentEditable_1.ContentEditable, { className: (0, classnames_1.default)('min-h-full body-sm text-content-primary cursor-text', {
179
182
  'field focus-visible:field-focused text-nowrap overflow-x-scroll scrollbar-hide': isField,
180
183
  'h-40 flex items-center px-l5': isField,
@@ -1,10 +1,9 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
2
  import { RichTextEditor } from './RichTextEditor';
3
- export declare function RichTextField({ id, className, field, minimal, autoFocus, standalone, disabled }: RichTextField.Props): import("react/jsx-runtime").JSX.Element;
3
+ export declare function RichTextField({ id, className, field, minimal, autoFocus, disabled }: RichTextField.Props): import("react/jsx-runtime").JSX.Element;
4
4
  export declare namespace RichTextField {
5
5
  type Props = Pick<RichTextEditor.Props, 'id' | 'className' | 'autoFocus' | 'disabled'> & {
6
6
  field: Field<Schema.RichTextField>;
7
- standalone?: boolean;
8
7
  minimal?: boolean;
9
8
  };
10
9
  }
@@ -3,20 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RichTextField = RichTextField;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const funnel_core_1 = require("@nascentdigital/funnel-core");
6
- const react_1 = require("react");
7
6
  const hooks_1 = require("../../hooks");
8
7
  const FieldLayout_1 = require("./FieldLayout");
9
8
  const RichTextEditor_1 = require("./RichTextEditor");
10
9
  // component
11
- function RichTextField({ id, className, field, minimal = false, autoFocus = false, standalone = false, disabled = false }) {
10
+ function RichTextField({ id, className, field, minimal = false, autoFocus = false, disabled = false }) {
12
11
  // bind props + state + hooks
13
12
  const { schema, required, value: data } = field;
14
- const { capabilities, size } = schema;
15
- const variant = (0, react_1.useMemo)(() => size === 'lg'
16
- ? 'editor'
17
- : size === 'md'
18
- ? 'area'
19
- : 'field', [size]);
13
+ const { capabilities, semantics } = schema;
20
14
  // bind field
21
15
  (0, hooks_1.useField)(field);
22
16
  // helpers
@@ -26,13 +20,7 @@ function RichTextField({ id, className, field, minimal = false, autoFocus = fals
26
20
  field.value = funnel_core_1.Schema.RichTextField.Value.toData(change.getData());
27
21
  };
28
22
  // create editor
29
- const editor = ((0, jsx_runtime_1.jsx)(RichTextEditor_1.RichTextEditor, { id: id, variant: variant, placeholder: schema.hint, required: required, disabled: disabled, autoFocus: autoFocus, standalone: standalone, richText: data === null || data === void 0 ? void 0 : data.value, options: capabilities, onChange: onChange }));
30
- // render standalone
31
- if (standalone) {
32
- return editor;
33
- }
23
+ const editor = ((0, jsx_runtime_1.jsx)(RichTextEditor_1.RichTextEditor, { id: id, variant: semantics, placeholder: schema.hint, required: required, disabled: disabled, autoFocus: autoFocus, richText: data === null || data === void 0 ? void 0 : data.value, options: capabilities, onChange: onChange }));
34
24
  // or within field
35
- else {
36
- return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: minimal ? 'minimal' : 'default', children: editor }));
37
- }
25
+ return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: minimal ? 'minimal' : 'default', children: editor }));
38
26
  }
@@ -1,21 +1,22 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
3
  import { FieldLayout } from './FieldLayout';
4
+ import { FieldSize } from './FieldSize';
4
5
  export declare const TextField: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "defaultValue" | "onFocus" | "onBlur" | "onChange"> & {
5
6
  field: Field<Schema.TextField>;
6
7
  variant?: FieldLayout.Variant;
8
+ size?: FieldSize;
7
9
  disabled?: boolean;
8
10
  secured?: boolean;
9
- small?: boolean;
10
11
  controls?: ReactNode;
11
12
  } & import("react").RefAttributes<TextField.Ref>>;
12
13
  export declare namespace TextField {
13
14
  type Props = Omit<HTMLAttributes<HTMLInputElement>, 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur'> & {
14
15
  field: Field<Schema.TextField>;
15
16
  variant?: FieldLayout.Variant;
17
+ size?: FieldSize;
16
18
  disabled?: boolean;
17
19
  secured?: boolean;
18
- small?: boolean;
19
20
  controls?: ReactNode;
20
21
  };
21
22
  interface Ref {
@@ -28,7 +28,7 @@ const FieldLayout_1 = require("./FieldLayout");
28
28
  // component
29
29
  exports.TextField = (0, react_1.forwardRef)(function TextField(_a, ref) {
30
30
  var _b, _c;
31
- var { id: externalId, className, field, autoFocus = false, onKeyDown = funnel_core_1.Fn.NoOp, disabled = false, secured = false, variant, small = false, controls } = _a, props = __rest(_a, ["id", "className", "field", "autoFocus", "onKeyDown", "disabled", "secured", "variant", "small", "controls"]);
31
+ var { id: externalId, className, field, size = 'md', autoFocus = false, onKeyDown = funnel_core_1.Fn.NoOp, disabled = false, secured = false, variant, controls } = _a, props = __rest(_a, ["id", "className", "field", "size", "autoFocus", "onKeyDown", "disabled", "secured", "variant", "controls"]);
32
32
  // bind props + state + hooks
33
33
  const { schema } = field;
34
34
  const isPassword = schema.semantics === 'password' || schema.semantics === 'password-input';
@@ -44,11 +44,12 @@ exports.TextField = (0, react_1.forwardRef)(function TextField(_a, ref) {
44
44
  const errors = field.getErrors(errorLevel);
45
45
  const hasErrors = errors.length > 0;
46
46
  const inputClassNames = (0, react_1.useMemo)(() => (0, classnames_1.default)('field', 'w-full flex items-center gap-l5 px-l5', {
47
- 'h-40': !small,
48
- 'h-32': small,
47
+ 'field-md h-40': size === 'md',
48
+ 'field-sm h-32': size === 'sm',
49
+ 'field-xs h-24': size === 'xs',
49
50
  'field-error': hasErrors,
50
51
  'field-disabled': disabled || locked
51
- }), [small, disabled, locked, hasErrors]);
52
+ }), [size, disabled, locked, hasErrors]);
52
53
  // bind field
53
54
  (0, hooks_1.useField)(field);
54
55
  // bind ref
@@ -105,7 +106,7 @@ exports.TextField = (0, react_1.forwardRef)(function TextField(_a, ref) {
105
106
  // render
106
107
  return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: (0, classnames_1.default)(className, {
107
108
  'w-full': variant !== 'wide'
108
- }), field: field, disabled: disabled, secured: secured, variant: variant, children: (0, jsx_runtime_1.jsxs)("div", { className: "w-full flex items-center gap-l5", children: [(0, jsx_runtime_1.jsxs)("div", { className: inputClassNames, children: [mask
109
+ }), field: field, size: size, disabled: disabled, secured: secured, variant: variant, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('w-full flex items-center gap-l5'), children: [(0, jsx_runtime_1.jsxs)("div", { className: inputClassNames, children: [mask
109
110
  ?
110
111
  (0, jsx_runtime_1.jsx)(client_1.MaskedInput, Object.assign({ ref: maskRef, id: id, className: "flex-1", name: `field-${field.id}`, placeholder: schema.hint, autoComplete: autoComplete, mask: mask, initialValue: (_b = funnel_core_1.Schema.TextField.Value.fromData(field.value)) !== null && _b !== void 0 ? _b : '', onValueChanged: value => field.value = funnel_core_1.Schema.TextField.Value.toData(value), onFocus: () => field.editing = true, onBlur: () => field.editing = false, onKeyDown: onKeyDown, disabled: disabled || locked }, props, (schema.semantics === 'password'
111
112
  ?
@@ -130,9 +131,9 @@ exports.TextField = (0, react_1.forwardRef)(function TextField(_a, ref) {
130
131
  (locked
131
132
  // unlock
132
133
  ?
133
- (0, jsx_runtime_1.jsx)(interaction_1.IconButton, { variant: "secondary", icon: locked ? 'LockOpen' : 'Lock', onClick: onSandbox })
134
+ (0, jsx_runtime_1.jsx)(interaction_1.IconButton, { variant: "secondary", icon: locked ? 'LockOpen' : 'Lock', size: size === 'md' ? 'md' : 'sm', onClick: onSandbox })
134
135
  :
135
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(interaction_1.IconButton, { variant: "secondary", icon: "X", onClick: onRollback }), (0, jsx_runtime_1.jsx)(interaction_1.IconButton, { variant: "primary", icon: "Check", disabled: !field.modified || !field.valid, onClick: onCommit })] }))] }) }));
136
+ (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(interaction_1.IconButton, { variant: "secondary", icon: "X", size: size === 'md' ? 'md' : 'sm', onClick: onRollback }), (0, jsx_runtime_1.jsx)(interaction_1.IconButton, { variant: "primary", icon: "Check", size: size === 'md' ? 'md' : 'sm', disabled: !field.modified || !field.valid, onClick: onCommit })] }))] }) }));
136
137
  });
137
138
  // helpers
138
139
  function getMask(schema) {
@@ -1,11 +1,13 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
2
  import { FieldLayout } from './FieldLayout';
3
- export declare function TimestampField({ className, field, variant, disabled, secured }: TimestampField.Props): import("react/jsx-runtime").JSX.Element;
3
+ import { FieldSize } from './FieldSize';
4
+ export declare function TimestampField({ className, field, variant, size, disabled, secured }: TimestampField.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace TimestampField {
5
6
  type Props = {
6
7
  className?: string;
7
8
  field: Field<Schema.TimestampField>;
8
9
  variant?: FieldLayout.Variant;
10
+ size?: FieldSize;
9
11
  autoFocus?: boolean;
10
12
  disabled?: boolean;
11
13
  secured?: boolean;
@@ -11,7 +11,7 @@ const hooks_1 = require("../../hooks");
11
11
  const interaction_1 = require("../interaction");
12
12
  const FieldLayout_1 = require("./FieldLayout");
13
13
  // component
14
- function TimestampField({ className, field, variant, disabled = false, secured = false }) {
14
+ function TimestampField({ className, field, variant, size = 'md', disabled = false, secured = false }) {
15
15
  // bind state + hooks
16
16
  const { id, name, value: data, schema, required } = field;
17
17
  const { hint, minTime, maxTime, defaultHour } = schema;
@@ -36,7 +36,7 @@ function TimestampField({ className, field, variant, disabled = false, secured =
36
36
  field.rollback();
37
37
  };
38
38
  // render
39
- return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: (0, classnames_1.default)(className, 'TextField-root'), field: field, variant: variant, disabled: disabled, secured: secured, children: (0, jsx_runtime_1.jsxs)("div", { className: "FieldLayout-inputWrap TextField-inputWrap", children: [(0, jsx_runtime_1.jsx)(interaction_1.DateTimePicker, { className: "FieldLayout-input TextField-input", minTime: funnel_core_1.Timestamp.coerceToDate(minTime), maxTime: funnel_core_1.Timestamp.coerceToDate(maxTime), defaultHour: defaultHour, placeholder: hint !== null && hint !== void 0 ? hint : 'Please select a date', date: date, onChange: onDateChanged, disabled: disabled || locked }), !required &&
39
+ return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: (0, classnames_1.default)(className, 'TextField-root'), field: field, variant: variant, size: size, disabled: disabled, secured: secured, children: (0, jsx_runtime_1.jsxs)("div", { className: "FieldLayout-inputWrap TextField-inputWrap", children: [(0, jsx_runtime_1.jsx)(interaction_1.DateTimePicker, { className: "FieldLayout-input TextField-input", minTime: funnel_core_1.Timestamp.coerceToDate(minTime), maxTime: funnel_core_1.Timestamp.coerceToDate(maxTime), defaultHour: defaultHour, placeholder: hint !== null && hint !== void 0 ? hint : 'Please select a date', date: date, onChange: onDateChanged, disabled: disabled || locked }), !required &&
40
40
  (0, jsx_runtime_1.jsx)(interaction_1.Button, { variant: "destructive", size: "sm", disabled: date === undefined || locked, onClick: () => field.value = undefined, children: "Clear" }), secured &&
41
41
  (locked
42
42
  // unlock