@veritone-ce/design-system 2.2.5 → 2.3.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 (53) hide show
  1. package/dist/cjs/Dialog/components.js +39 -13
  2. package/dist/cjs/Dialog/styles.module.scss.js +1 -1
  3. package/dist/cjs/Drawer/components.js +46 -13
  4. package/dist/cjs/Drawer/styles.module.scss.js +1 -1
  5. package/dist/cjs/FormControl/context.js +16 -0
  6. package/dist/cjs/FormControl/index.js +63 -0
  7. package/dist/cjs/FormControl/styles.module.scss.js +7 -0
  8. package/dist/cjs/Input/index.js +42 -52
  9. package/dist/cjs/Input/styles.module.scss.js +1 -1
  10. package/dist/cjs/Menu/controlled.js +2 -0
  11. package/dist/cjs/Select/controlled.js +35 -56
  12. package/dist/cjs/Select/styles.module.scss.js +1 -1
  13. package/dist/cjs/TablePagination/index.js +18 -20
  14. package/dist/cjs/TablePagination/styles.module.scss.js +1 -1
  15. package/dist/cjs/Textarea/index.js +33 -44
  16. package/dist/cjs/Textarea/styles.module.scss.js +1 -1
  17. package/dist/cjs/Typography/index.js +2 -1
  18. package/dist/cjs/Typography/variants.module.scss.js +1 -1
  19. package/dist/cjs/styles/typography.js +9 -1
  20. package/dist/cjs/styles.css +8 -7
  21. package/dist/esm/Dialog/components.js +40 -14
  22. package/dist/esm/Dialog/styles.module.scss.js +1 -1
  23. package/dist/esm/Drawer/components.js +47 -14
  24. package/dist/esm/Drawer/styles.module.scss.js +1 -1
  25. package/dist/esm/FormControl/context.js +13 -0
  26. package/dist/esm/FormControl/index.js +59 -0
  27. package/dist/esm/FormControl/styles.module.scss.js +3 -0
  28. package/dist/esm/Input/index.js +42 -52
  29. package/dist/esm/Input/styles.module.scss.js +1 -1
  30. package/dist/esm/Menu/controlled.js +2 -0
  31. package/dist/esm/Select/controlled.js +35 -56
  32. package/dist/esm/Select/styles.module.scss.js +1 -1
  33. package/dist/esm/TablePagination/index.js +15 -17
  34. package/dist/esm/TablePagination/styles.module.scss.js +1 -1
  35. package/dist/esm/Textarea/index.js +34 -45
  36. package/dist/esm/Textarea/styles.module.scss.js +1 -1
  37. package/dist/esm/Typography/index.js +2 -1
  38. package/dist/esm/Typography/variants.module.scss.js +1 -1
  39. package/dist/esm/styles/scss/theme.generated.scss +25 -1
  40. package/dist/esm/styles/typography.js +9 -1
  41. package/dist/esm/styles.css +8 -7
  42. package/dist/types/Dialog/components.d.ts +2 -0
  43. package/dist/types/Dialog/factory.d.ts +1 -0
  44. package/dist/types/Drawer/components.d.ts +5 -0
  45. package/dist/types/Drawer/factory.d.ts +2 -0
  46. package/dist/types/FormControl/context.d.ts +7 -0
  47. package/dist/types/FormControl/index.d.ts +15 -0
  48. package/dist/types/Input/index.d.ts +3 -8
  49. package/dist/types/Menu/controlled.d.ts +2 -1
  50. package/dist/types/Select/types.d.ts +1 -3
  51. package/dist/types/Textarea/index.d.ts +4 -7
  52. package/dist/types/styles/typography.d.ts +1 -1
  53. package/package.json +1 -1
@@ -48,32 +48,58 @@ const Dialog = React__namespace.forwardRef(function Dialog2({
48
48
  overlayStyle,
49
49
  overlayClassName,
50
50
  lockScroll = true,
51
+ disableAutoFocus = false,
51
52
  "data-testid": dataTestId,
52
53
  ...options
53
54
  }, propRef) {
54
55
  const dialog = state.useDialog(options);
56
+ const { isMounted: overlayIsMounted, styles: overlayTransitionStyles } = react.useTransitionStyles(dialog.context, {
57
+ duration: 225,
58
+ initial: {
59
+ opacity: 0
60
+ }
61
+ });
62
+ const { isMounted: innerIsMounted, styles: innerTransitionStyles } = react.useTransitionStyles(dialog.context, {
63
+ duration: 225,
64
+ initial: {
65
+ transform: `scale(95%)`
66
+ }
67
+ });
55
68
  const ref = react.useMergeRefs([dialog.context.refs.setFloating, propRef]);
56
69
  let content = null;
57
- if (dialog.context.open) {
70
+ if (overlayIsMounted || innerIsMounted) {
58
71
  content = /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { root: portalEl, children: /* @__PURE__ */ jsxRuntime.jsx(
59
72
  react.FloatingOverlay,
60
73
  {
61
- style: overlayStyle,
74
+ style: {
75
+ ...overlayTransitionStyles,
76
+ ...overlayStyle
77
+ },
62
78
  className: cx.cx(styles_module.default["dialog-overlay"], overlayClassName),
63
79
  lockScroll,
64
- children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingFocusManager, { context: dialog.context, children: /* @__PURE__ */ jsxRuntime.jsx(portal.PortalThemeRelay, { children: /* @__PURE__ */ jsxRuntime.jsx(
65
- "div",
80
+ children: /* @__PURE__ */ jsxRuntime.jsx(
81
+ react.FloatingFocusManager,
66
82
  {
67
- ref,
68
- "aria-labelledby": dialog.labelId,
69
- "aria-describedby": dialog.descriptionId,
70
- ...dialog.getFloatingProps(),
71
- "data-testid": dataTestId,
72
- style,
73
- className: cx.cx(styles_module.default["dialog"], className),
74
- children
83
+ context: dialog.context,
84
+ disabled: disableAutoFocus,
85
+ children: /* @__PURE__ */ jsxRuntime.jsx(portal.PortalThemeRelay, { children: /* @__PURE__ */ jsxRuntime.jsx(
86
+ "div",
87
+ {
88
+ ref,
89
+ "aria-labelledby": dialog.labelId,
90
+ "aria-describedby": dialog.descriptionId,
91
+ ...dialog.getFloatingProps(),
92
+ "data-testid": dataTestId,
93
+ style: {
94
+ ...innerTransitionStyles,
95
+ ...style
96
+ },
97
+ className: cx.cx(styles_module.default["dialog"], className),
98
+ children
99
+ }
100
+ ) })
75
101
  }
76
- ) }) })
102
+ )
77
103
  }
78
104
  ) });
79
105
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var modules_efc4e723 = {"dialog-overlay":"vt_ce_Dialog_dialogOverlay__19d426a2","dialog":"vt_ce_Dialog_dialog__19d426a2","dialog-start":"vt_ce_Dialog_dialogStart__19d426a2","dialog-end":"vt_ce_Dialog_dialogEnd__19d426a2","dialog-content":"vt_ce_Dialog_dialogContent__19d426a2","dialog-title":"vt_ce_Dialog_dialogTitle__19d426a2","dialog-typography":"vt_ce_Dialog_dialogTypography__19d426a2","dialog-actions":"vt_ce_Dialog_dialogActions__19d426a2"};
5
+ var modules_efc4e723 = {"dialog-overlay":"vt_ce_Dialog_dialogOverlay__36db6625","dialog":"vt_ce_Dialog_dialog__36db6625","dialog-start":"vt_ce_Dialog_dialogStart__36db6625","dialog-end":"vt_ce_Dialog_dialogEnd__36db6625","dialog-content":"vt_ce_Dialog_dialogContent__36db6625","dialog-title":"vt_ce_Dialog_dialogTitle__36db6625","dialog-typography":"vt_ce_Dialog_dialogTypography__36db6625","dialog-actions":"vt_ce_Dialog_dialogActions__36db6625"};
6
6
 
7
7
  exports.default = modules_efc4e723;
@@ -41,6 +41,7 @@ function _interopNamespaceDefault(e) {
41
41
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
42
42
 
43
43
  const Drawer = React__namespace.forwardRef(function Drawer2({
44
+ placement = "end",
44
45
  children,
45
46
  portalEl,
46
47
  style,
@@ -50,6 +51,7 @@ const Drawer = React__namespace.forwardRef(function Drawer2({
50
51
  overlayStyle,
51
52
  overlayClassName,
52
53
  lockScroll = true,
54
+ disableAutoFocus = false,
53
55
  "data-testid": dataTestId,
54
56
  ...options
55
57
  }, propRef) {
@@ -57,37 +59,68 @@ const Drawer = React__namespace.forwardRef(function Drawer2({
57
59
  ...options,
58
60
  dismissEnabled: overlay
59
61
  });
62
+ const { isMounted: overlayIsMounted, styles: overlayTransitionStyles } = react.useTransitionStyles(drawer.context, {
63
+ duration: 225,
64
+ initial: {
65
+ opacity: 0
66
+ }
67
+ });
68
+ const { isMounted: innerIsMounted, styles: innerTransitionStyles } = react.useTransitionStyles(drawer.context, {
69
+ duration: 225,
70
+ initial: {
71
+ transform: `translateX(${placement === "start" ? "-66px" : "66px"})`
72
+ }
73
+ });
60
74
  const ref = react.useMergeRefs([drawer.context.refs.setFloating, propRef]);
61
75
  const strategyCn = styles_module.default[`drawer-overlay-strategy-${strategy}`];
76
+ const placementCn = styles_module.default[`drawer-overlay-placement-${placement}`];
62
77
  let content = null;
63
- if (drawer.context.open) {
64
- content = /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { root: portalEl, children: /* @__PURE__ */ jsxRuntime.jsx(
78
+ if (overlayIsMounted || innerIsMounted) {
79
+ content = /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { root: portalEl, children: /* @__PURE__ */ jsxRuntime.jsx(reactRemoveScroll.RemoveScroll, { enabled: overlay && lockScroll, children: /* @__PURE__ */ jsxRuntime.jsx(
65
80
  "div",
66
81
  {
67
- style: overlayStyle,
82
+ style: {
83
+ ...overlayTransitionStyles,
84
+ ...overlayStyle
85
+ },
68
86
  className: cx.cx(
69
87
  styles_module.default["drawer-overlay"],
70
88
  strategyCn,
89
+ placementCn,
71
90
  overlay && styles_module.default["drawer-overlay-enabled"],
72
91
  overlayClassName
73
92
  ),
74
- children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingFocusManager, { context: drawer.context, children: /* @__PURE__ */ jsxRuntime.jsx(
75
- reactRemoveScroll.RemoveScroll,
93
+ children: /* @__PURE__ */ jsxRuntime.jsx(
94
+ "div",
76
95
  {
77
- as: "div",
78
- enabled: overlay && lockScroll,
79
96
  ref,
97
+ ...drawer.getFloatingProps(),
80
98
  "aria-labelledby": drawer.labelId,
81
99
  "aria-describedby": drawer.descriptionId,
82
- ...drawer.getFloatingProps(),
83
100
  "data-testid": dataTestId,
84
- style,
85
- className: cx.cx(styles_module.default["drawer"], className),
86
- children
101
+ className: styles_module.default["drawer-wrapper"],
102
+ children: /* @__PURE__ */ jsxRuntime.jsx(
103
+ react.FloatingFocusManager,
104
+ {
105
+ context: drawer.context,
106
+ disabled: disableAutoFocus,
107
+ children: /* @__PURE__ */ jsxRuntime.jsx(
108
+ "div",
109
+ {
110
+ className: cx.cx(styles_module.default["drawer"], className),
111
+ style: {
112
+ ...innerTransitionStyles,
113
+ ...style
114
+ },
115
+ children
116
+ }
117
+ )
118
+ }
119
+ )
87
120
  }
88
- ) })
121
+ )
89
122
  }
90
- ) });
123
+ ) }) });
91
124
  }
92
125
  return /* @__PURE__ */ jsxRuntime.jsx(state.DrawerContext.Provider, { value: drawer, children: content });
93
126
  });
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var modules_efc4e723 = {"drawer-overlay":"vt_ce_Drawer_drawerOverlay__15fba194","drawer-overlay-enabled":"vt_ce_Drawer_drawerOverlayEnabled__15fba194","drawer-overlay-strategy-fixed":"vt_ce_Drawer_drawerOverlayStrategyFixed__15fba194","drawer-overlay-strategy-absolute":"vt_ce_Drawer_drawerOverlayStrategyAbsolute__15fba194","drawer":"vt_ce_Drawer_drawer__15fba194","drawer-start":"vt_ce_Drawer_drawerStart__15fba194","drawer-end":"vt_ce_Drawer_drawerEnd__15fba194","drawer-content":"vt_ce_Drawer_drawerContent__15fba194","drawer-title-container":"vt_ce_Drawer_drawerTitleContainer__15fba194","drawer-title":"vt_ce_Drawer_drawerTitle__15fba194","drawer-title-actions":"vt_ce_Drawer_drawerTitleActions__15fba194","drawer-typography":"vt_ce_Drawer_drawerTypography__15fba194","drawer-actions":"vt_ce_Drawer_drawerActions__15fba194"};
5
+ var modules_efc4e723 = {"drawer-overlay":"vt_ce_Drawer_drawerOverlay__923c77c9","drawer-overlay-enabled":"vt_ce_Drawer_drawerOverlayEnabled__923c77c9","drawer-overlay-strategy-fixed":"vt_ce_Drawer_drawerOverlayStrategyFixed__923c77c9","drawer-overlay-strategy-absolute":"vt_ce_Drawer_drawerOverlayStrategyAbsolute__923c77c9","drawer-overlay-placement-start":"vt_ce_Drawer_drawerOverlayPlacementStart__923c77c9","drawer":"vt_ce_Drawer_drawer__923c77c9","drawer-overlay-placement-end":"vt_ce_Drawer_drawerOverlayPlacementEnd__923c77c9","drawer-wrapper":"vt_ce_Drawer_drawerWrapper__923c77c9","drawer-start":"vt_ce_Drawer_drawerStart__923c77c9","drawer-end":"vt_ce_Drawer_drawerEnd__923c77c9","drawer-content":"vt_ce_Drawer_drawerContent__923c77c9","drawer-title-container":"vt_ce_Drawer_drawerTitleContainer__923c77c9","drawer-title":"vt_ce_Drawer_drawerTitle__923c77c9","drawer-title-actions":"vt_ce_Drawer_drawerTitleActions__923c77c9","drawer-typography":"vt_ce_Drawer_drawerTypography__923c77c9","drawer-actions":"vt_ce_Drawer_drawerActions__923c77c9"};
6
6
 
7
7
  exports.default = modules_efc4e723;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+ 'use client';
3
+ 'use strict';
4
+
5
+ var React = require('react');
6
+
7
+ const FormControlContext = React.createContext({
8
+ error: false,
9
+ disabled: false
10
+ });
11
+ function useFormControlContext() {
12
+ return React.useContext(FormControlContext);
13
+ }
14
+
15
+ exports.FormControlContext = FormControlContext;
16
+ exports.useFormControlContext = useFormControlContext;
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+ 'use client';
3
+ 'use strict';
4
+
5
+ Object.defineProperty(exports, '__esModule', { value: true });
6
+
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var React = require('react');
9
+ var styles_module = require('./styles.module.scss.js');
10
+ require('color2k');
11
+ require('../styles/css-vars.js');
12
+ var cx = require('../styles/cx.js');
13
+ require('../styles/defaultTheme.js');
14
+ require('@mui/system');
15
+ require('../Box/index.js');
16
+ require('../styles/styled.js');
17
+ var context = require('./context.js');
18
+
19
+ const FormControl = React.forwardRef(
20
+ ({ placement = "block-start", ...props }, ref) => {
21
+ const context$1 = {
22
+ error: Boolean(props.error),
23
+ disabled: Boolean(props.disabled)
24
+ };
25
+ return /* @__PURE__ */ jsxRuntime.jsxs(
26
+ "span",
27
+ {
28
+ ref,
29
+ "data-testid": props["data-testid"],
30
+ "data-error": context$1.error,
31
+ "data-disabled": context$1.disabled,
32
+ className: cx.cx(
33
+ styles_module.default["form-control"],
34
+ styles_module.default[`placement-${placement}`],
35
+ props.className
36
+ ),
37
+ style: props.style,
38
+ children: [
39
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: styles_module.default["label"], children: props.label }),
40
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["inner-control"], children: /* @__PURE__ */ jsxRuntime.jsx(context.FormControlContext.Provider, { value: context$1, children: props.children }) }),
41
+ props.helpLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["help-label"], children: props.helpLabel }),
42
+ props.error && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_module.default["error-label"], children: [
43
+ /* @__PURE__ */ jsxRuntime.jsx(IndicatorCircle, {}),
44
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: props.error === true ? "An error has occurred." : props.error })
45
+ ] })
46
+ ]
47
+ }
48
+ );
49
+ }
50
+ );
51
+ const IndicatorCircle = () => /* @__PURE__ */ jsxRuntime.jsx(
52
+ "svg",
53
+ {
54
+ width: "12",
55
+ height: "12",
56
+ viewBox: "0 0 12 12",
57
+ fill: "none",
58
+ xmlns: "http://www.w3.org/2000/svg",
59
+ children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6", cy: "6", r: "6", fill: "currentColor" })
60
+ }
61
+ );
62
+
63
+ exports.default = FormControl;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var modules_efc4e723 = {"form-control":"vt_ce_FormControl_formControl__8c1edd74","placement-block-start":"vt_ce_FormControl_placementBlockStart__8c1edd74","label":"vt_ce_FormControl_label__8c1edd74","placement-inline-start":"vt_ce_FormControl_placementInlineStart__8c1edd74","placement-inline-end":"vt_ce_FormControl_placementInlineEnd__8c1edd74","inner-control":"vt_ce_FormControl_innerControl__8c1edd74","help-label":"vt_ce_FormControl_helpLabel__8c1edd74","error-label":"vt_ce_FormControl_errorLabel__8c1edd74"};
6
+
7
+ exports.default = modules_efc4e723;
@@ -7,6 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var React = require('react');
9
9
  var styles_module = require('./styles.module.scss.js');
10
+ var context = require('../FormControl/context.js');
10
11
  require('color2k');
11
12
  require('../styles/css-vars.js');
12
13
  var cx = require('../styles/cx.js');
@@ -15,58 +16,47 @@ require('@mui/system');
15
16
  require('../Box/index.js');
16
17
  require('../styles/styled.js');
17
18
 
18
- const Input = React.forwardRef((props, ref) => {
19
- return /* @__PURE__ */ jsxRuntime.jsxs(
20
- "span",
21
- {
22
- "data-testid": props["data-testid"],
23
- className: cx.cx(styles_module.default["input"], props.className),
24
- style: props.style,
25
- children: [
26
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: styles_module.default["label"], children: props.label }),
27
- /* @__PURE__ */ jsxRuntime.jsxs(
28
- "span",
29
- {
30
- "data-disabled": props.disabled ?? false,
31
- "data-error": props.error !== void 0,
32
- className: styles_module.default["inner-input-container"],
33
- children: [
34
- props.startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["input-icon"], children: props.startIcon }),
35
- /* @__PURE__ */ jsxRuntime.jsx(
36
- "input",
37
- {
38
- ref,
39
- type: props.type,
40
- name: props.name,
41
- placeholder: props.placeholder,
42
- value: props.value,
43
- disabled: props.disabled,
44
- onChange: props.onChange,
45
- className: styles_module.default["inner-input"]
46
- }
47
- ),
48
- props.endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["input-icon"], children: props.endIcon })
49
- ]
50
- }
51
- ),
52
- props.helpLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["help-label"], children: props.helpLabel }),
53
- props.error && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_module.default["error-label"], children: [
54
- /* @__PURE__ */ jsxRuntime.jsx(IndicatorCircle, {}),
55
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: props.error })
56
- ] })
57
- ]
58
- }
59
- );
60
- });
61
- const IndicatorCircle = () => /* @__PURE__ */ jsxRuntime.jsx(
62
- "svg",
63
- {
64
- width: "12",
65
- height: "12",
66
- viewBox: "0 0 12 12",
67
- fill: "none",
68
- xmlns: "http://www.w3.org/2000/svg",
69
- children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6", cy: "6", r: "6", fill: "currentColor" })
19
+ const Input = React.forwardRef(
20
+ ({
21
+ placeholder,
22
+ value,
23
+ error: propsError,
24
+ disabled: propsDisabled,
25
+ startIcon,
26
+ endIcon,
27
+ "data-testid": dataTestId,
28
+ style,
29
+ className,
30
+ ...props
31
+ }, ref) => {
32
+ const ctx = context.useFormControlContext();
33
+ const error = propsError ?? ctx.error;
34
+ const disabled = propsDisabled ?? ctx.disabled;
35
+ return /* @__PURE__ */ jsxRuntime.jsxs(
36
+ "span",
37
+ {
38
+ "data-disabled": disabled,
39
+ "data-error": error,
40
+ "data-testid": dataTestId,
41
+ style,
42
+ className: cx.cx(styles_module.default["input"], className),
43
+ children: [
44
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["input-icon"], children: startIcon }),
45
+ /* @__PURE__ */ jsxRuntime.jsx(
46
+ "input",
47
+ {
48
+ ref,
49
+ ...props,
50
+ placeholder,
51
+ value,
52
+ disabled,
53
+ className: styles_module.default["inner-input"]
54
+ }
55
+ ),
56
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["input-icon"], children: endIcon })
57
+ ]
58
+ }
59
+ );
70
60
  }
71
61
  );
72
62
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var modules_efc4e723 = {"input":"vt_ce_Input_input__f7983a21","label":"vt_ce_Input_label__f7983a21","inner-input-container":"vt_ce_Input_innerInputContainer__f7983a21","inner-input":"vt_ce_Input_innerInput__f7983a21","input-icon":"vt_ce_Input_inputIcon__f7983a21","help-label":"vt_ce_Input_helpLabel__f7983a21","error-label":"vt_ce_Input_errorLabel__f7983a21"};
5
+ var modules_efc4e723 = {"input":"vt_ce_Input_input__a83b3209","inner-input":"vt_ce_Input_innerInput__a83b3209","input-icon":"vt_ce_Input_inputIcon__a83b3209"};
6
6
 
7
7
  exports.default = modules_efc4e723;
@@ -27,6 +27,7 @@ function Menu({
27
27
  matchAnchorWidth = false,
28
28
  options,
29
29
  dismissEnabled = true,
30
+ disableAutoFocus = false,
30
31
  className,
31
32
  ...props
32
33
  }) {
@@ -93,6 +94,7 @@ function Menu({
93
94
  {
94
95
  context,
95
96
  modal: false,
97
+ disabled: disableAutoFocus,
96
98
  order: ["reference", "content"],
97
99
  children: /* @__PURE__ */ jsxRuntime.jsx(portal.PortalThemeRelay, { children: /* @__PURE__ */ jsxRuntime.jsx(
98
100
  "div",
@@ -18,6 +18,7 @@ var iconsMaterial = require('@mui/icons-material');
18
18
  var controlled = require('../Menu/controlled.js');
19
19
  var wrappers = require('../Icon/wrappers.js');
20
20
  require('../Icon/factory.js');
21
+ var context = require('../FormControl/context.js');
21
22
 
22
23
  const DefaultEndIcon = wrappers.adaptMuiSvgIcon(iconsMaterial.ArrowDropDown);
23
24
  const DefaultUnsetIcon = wrappers.adaptMuiSvgIcon(iconsMaterial.Close);
@@ -28,6 +29,9 @@ function ControlledSelect({
28
29
  clearable = true,
29
30
  ...props
30
31
  }) {
32
+ const ctx = context.useFormControlContext();
33
+ const error = props.error ?? ctx.error;
34
+ const disabled = props.disabled ?? ctx.disabled;
31
35
  const anchorId = React.useId();
32
36
  const anchorRef = React.useRef(null);
33
37
  const [open, setOpen] = React.useState(false);
@@ -48,58 +52,44 @@ function ControlledSelect({
48
52
  {
49
53
  id: anchorId,
50
54
  ref: anchorRef,
51
- className: cx.cx(styles_module.default["select"], props.className),
55
+ "data-focused": open,
56
+ "data-disabled": disabled,
57
+ "data-error": error,
58
+ onClick: () => setOpen(true),
52
59
  "data-testid": props["data-testid"],
53
60
  style: props.style,
54
- onClick: () => setOpen(true),
61
+ className: cx.cx(styles_module.default["select"], props.className),
55
62
  children: [
56
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: styles_module.default["label"], children: props.label }),
57
- /* @__PURE__ */ jsxRuntime.jsxs(
63
+ props.startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["select-icon"], children: props.startIcon }),
64
+ /* @__PURE__ */ jsxRuntime.jsx(
65
+ "input",
66
+ {
67
+ ref,
68
+ type: "text",
69
+ size: props.size,
70
+ "data-selected": Boolean(selectedOption),
71
+ placeholder: selectedOption?.label ?? placeholder,
72
+ value: props.inputValue,
73
+ disabled: props.disabled,
74
+ onChange: (e) => {
75
+ setOpen(true);
76
+ props.onInputChange(e, e.target.value);
77
+ },
78
+ className: styles_module.default["inner-input"]
79
+ }
80
+ ),
81
+ selectedOption && clearable && /* @__PURE__ */ jsxRuntime.jsx(
58
82
  "span",
59
83
  {
60
- "data-focused": open,
61
- "data-disabled": props.disabled ?? false,
62
- "data-error": props.error !== void 0,
63
- className: styles_module.default["inner-input-container"],
64
- children: [
65
- props.startIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["select-icon"], children: props.startIcon }),
66
- /* @__PURE__ */ jsxRuntime.jsx(
67
- "input",
68
- {
69
- ref,
70
- type: "text",
71
- size: props.size,
72
- "data-selected": Boolean(selectedOption),
73
- placeholder: selectedOption?.label ?? placeholder,
74
- value: props.inputValue,
75
- disabled: props.disabled,
76
- onChange: (e) => {
77
- setOpen(true);
78
- props.onInputChange(e, e.target.value);
79
- },
80
- className: styles_module.default["inner-input"]
81
- }
82
- ),
83
- selectedOption && clearable && /* @__PURE__ */ jsxRuntime.jsx(
84
- "span",
85
- {
86
- className: styles_module.default["select-icon"],
87
- onClick: (e) => {
88
- props.onChange?.(e, null);
89
- props.onInputChange(e, "");
90
- },
91
- children: unsetIcon
92
- }
93
- ),
94
- endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["select-icon"], children: endIcon })
95
- ]
84
+ className: styles_module.default["select-icon"],
85
+ onClick: (e) => {
86
+ props.onChange?.(e, null);
87
+ props.onInputChange(e, "");
88
+ },
89
+ children: unsetIcon
96
90
  }
97
91
  ),
98
- props.helpLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["help-label"], children: props.helpLabel }),
99
- props.error && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_module.default["error-label"], children: [
100
- /* @__PURE__ */ jsxRuntime.jsx(IndicatorCircle, {}),
101
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: props.error })
102
- ] })
92
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["select-icon"], children: endIcon })
103
93
  ]
104
94
  }
105
95
  ),
@@ -130,16 +120,5 @@ function ControlledSelect({
130
120
  )
131
121
  ] });
132
122
  }
133
- const IndicatorCircle = () => /* @__PURE__ */ jsxRuntime.jsx(
134
- "svg",
135
- {
136
- width: "12",
137
- height: "12",
138
- viewBox: "0 0 12 12",
139
- fill: "none",
140
- xmlns: "http://www.w3.org/2000/svg",
141
- children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6", cy: "6", r: "6", fill: "currentColor" })
142
- }
143
- );
144
123
 
145
124
  exports.default = ControlledSelect;
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var modules_efc4e723 = {"select":"vt_ce_Select_select__cb05e024","label":"vt_ce_Select_label__cb05e024","inner-input-container":"vt_ce_Select_innerInputContainer__cb05e024","inner-input":"vt_ce_Select_innerInput__cb05e024","select-icon":"vt_ce_Select_selectIcon__cb05e024","help-label":"vt_ce_Select_helpLabel__cb05e024","error-label":"vt_ce_Select_errorLabel__cb05e024"};
5
+ var modules_efc4e723 = {"select":"vt_ce_Select_select__a4ea9d62","inner-input":"vt_ce_Select_innerInput__a4ea9d62","select-icon":"vt_ce_Select_selectIcon__a4ea9d62"};
6
6
 
7
7
  exports.default = modules_efc4e723;
@@ -6,11 +6,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
 
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var styles_module = require('./styles.module.scss.js');
9
- var index = require('../IconButton/index.js');
9
+ var index$1 = require('../IconButton/index.js');
10
10
  var internal = require('../Icon/internal.js');
11
11
  require('../Select/controlled.js');
12
12
  var uncontrolled = require('../Select/uncontrolled.js');
13
13
  require('react');
14
+ var index = require('../FormControl/index.js');
14
15
 
15
16
  function TablePagination({
16
17
  page,
@@ -23,23 +24,20 @@ function TablePagination({
23
24
  const showPrev = page !== 1;
24
25
  const showNext = page < count / rowsPerPage;
25
26
  return /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: styles_module.default["container"], children: [
26
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_module.default["rows-per-page"], children: [
27
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: styles_module.default["rows-per-page-label"], children: rowsPerPageLabel }),
28
- /* @__PURE__ */ jsxRuntime.jsx(
29
- uncontrolled.default,
30
- {
31
- defaultValue: rowsPerPage,
32
- clearable: false,
33
- size: rowsPerPageOptions.length > 0 ? getDigits(Math.max(...rowsPerPageOptions)) : 3,
34
- options: rowsPerPageOptions.map((option) => ({
35
- label: option.toLocaleString(),
36
- value: option
37
- })),
38
- onChange: (_, newRowsPerPage) => props.onRowsPerPageChange?.(newRowsPerPage),
39
- className: styles_module.default["rows-per-page-select"]
40
- }
41
- )
42
- ] }),
27
+ /* @__PURE__ */ jsxRuntime.jsx(index.default, { label: rowsPerPageLabel, placement: "inline-start", children: /* @__PURE__ */ jsxRuntime.jsx(
28
+ uncontrolled.default,
29
+ {
30
+ defaultValue: rowsPerPage,
31
+ clearable: false,
32
+ size: rowsPerPageOptions.length > 0 ? getDigits(Math.max(...rowsPerPageOptions)) + 1 : 3,
33
+ options: rowsPerPageOptions.map((option) => ({
34
+ label: option.toLocaleString(),
35
+ value: option
36
+ })),
37
+ onChange: (_, newRowsPerPage) => props.onRowsPerPageChange?.(newRowsPerPage),
38
+ className: styles_module.default["rows-per-page-select"]
39
+ }
40
+ ) }),
43
41
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_module.default["page-counts"], children: [
44
42
  (page - 1) * rowsPerPage + 1,
45
43
  "-",
@@ -50,7 +48,7 @@ function TablePagination({
50
48
  ] }),
51
49
  /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: styles_module.default["btn-list"], children: [
52
50
  /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
53
- index.default,
51
+ index$1.default,
54
52
  {
55
53
  type: "button",
56
54
  disabled: !showPrev,
@@ -59,7 +57,7 @@ function TablePagination({
59
57
  }
60
58
  ) }),
61
59
  /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
62
- index.default,
60
+ index$1.default,
63
61
  {
64
62
  type: "button",
65
63
  disabled: !showNext,
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var modules_efc4e723 = {"container":"vt_ce_TablePagination_container__8da45ccd","rows-per-page":"vt_ce_TablePagination_rowsPerPage__8da45ccd","rows-per-page-label":"vt_ce_TablePagination_rowsPerPageLabel__8da45ccd","rows-per-page-select":"vt_ce_TablePagination_rowsPerPageSelect__8da45ccd","page-counts":"vt_ce_TablePagination_pageCounts__8da45ccd","btn-list":"vt_ce_TablePagination_btnList__8da45ccd","ellipsis":"vt_ce_TablePagination_ellipsis__8da45ccd"};
5
+ var modules_efc4e723 = {"container":"vt_ce_TablePagination_container__b08ac6ea","rows-per-page-select":"vt_ce_TablePagination_rowsPerPageSelect__b08ac6ea","page-counts":"vt_ce_TablePagination_pageCounts__b08ac6ea","btn-list":"vt_ce_TablePagination_btnList__b08ac6ea","ellipsis":"vt_ce_TablePagination_ellipsis__b08ac6ea"};
6
6
 
7
7
  exports.default = modules_efc4e723;