@veeqo/ui 9.2.0 → 9.4.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 (79) hide show
  1. package/dist/components/DimensionsInput/DimensionsInput.cjs +8 -8
  2. package/dist/components/DimensionsInput/DimensionsInput.cjs.map +1 -1
  3. package/dist/components/DimensionsInput/DimensionsInput.js +9 -9
  4. package/dist/components/DimensionsInput/DimensionsInput.js.map +1 -1
  5. package/dist/components/DimensionsInput/index.cjs +10 -0
  6. package/dist/components/DimensionsInput/index.cjs.map +1 -0
  7. package/dist/components/DimensionsInput/index.d.ts +2 -1
  8. package/dist/components/DimensionsInput/index.js +8 -0
  9. package/dist/components/DimensionsInput/index.js.map +1 -0
  10. package/dist/components/DimensionsInput/styled.cjs +2 -7
  11. package/dist/components/DimensionsInput/styled.cjs.map +1 -1
  12. package/dist/components/DimensionsInput/styled.d.ts +1 -11
  13. package/dist/components/DimensionsInput/styled.js +3 -7
  14. package/dist/components/DimensionsInput/styled.js.map +1 -1
  15. package/dist/components/DimensionsInput/types.d.ts +2 -5
  16. package/dist/components/Image/Image.cjs +2 -2
  17. package/dist/components/InputGroup/components/InputGroupLabel/InputGroupLabel.cjs +15 -0
  18. package/dist/components/InputGroup/components/InputGroupLabel/InputGroupLabel.cjs.map +1 -0
  19. package/dist/components/InputGroup/components/InputGroupLabel/InputGroupLabel.d.ts +9 -0
  20. package/dist/components/InputGroup/components/InputGroupLabel/InputGroupLabel.js +9 -0
  21. package/dist/components/InputGroup/components/InputGroupLabel/InputGroupLabel.js.map +1 -0
  22. package/dist/components/InputGroup/components/InputGroupLabel/index.d.ts +1 -0
  23. package/dist/components/InputGroup/components/InputGroupLabel/styled.cjs +13 -0
  24. package/dist/components/InputGroup/components/InputGroupLabel/styled.cjs.map +1 -0
  25. package/dist/components/InputGroup/components/InputGroupLabel/styled.d.ts +4 -0
  26. package/dist/components/InputGroup/components/InputGroupLabel/styled.js +7 -0
  27. package/dist/components/InputGroup/components/InputGroupLabel/styled.js.map +1 -0
  28. package/dist/components/InputGroup/index.cjs +4 -1
  29. package/dist/components/InputGroup/index.cjs.map +1 -1
  30. package/dist/components/InputGroup/index.d.ts +1 -0
  31. package/dist/components/InputGroup/index.js +4 -1
  32. package/dist/components/InputGroup/index.js.map +1 -1
  33. package/dist/components/Modal/Modal.cjs +3 -2
  34. package/dist/components/Modal/Modal.cjs.map +1 -1
  35. package/dist/components/Modal/Modal.js +3 -2
  36. package/dist/components/Modal/Modal.js.map +1 -1
  37. package/dist/components/Modal/types.cjs.map +1 -1
  38. package/dist/components/Modal/types.d.ts +1 -0
  39. package/dist/components/Modal/types.js.map +1 -1
  40. package/dist/components/Modal/utils.cjs +9 -0
  41. package/dist/components/Modal/utils.cjs.map +1 -0
  42. package/dist/components/Modal/utils.d.ts +1 -0
  43. package/dist/components/Modal/utils.js +7 -0
  44. package/dist/components/Modal/utils.js.map +1 -0
  45. package/dist/components/Popover/Popover.cjs +8 -5
  46. package/dist/components/Popover/Popover.cjs.map +1 -1
  47. package/dist/components/Popover/Popover.js +8 -5
  48. package/dist/components/Popover/Popover.js.map +1 -1
  49. package/dist/components/Portal/Portal.cjs +23 -40
  50. package/dist/components/Portal/Portal.cjs.map +1 -1
  51. package/dist/components/Portal/Portal.d.ts +2 -12
  52. package/dist/components/Portal/Portal.js +23 -40
  53. package/dist/components/Portal/Portal.js.map +1 -1
  54. package/dist/components/Portal/utils.cjs +11 -0
  55. package/dist/components/Portal/utils.cjs.map +1 -0
  56. package/dist/components/Portal/utils.d.ts +1 -0
  57. package/dist/components/Portal/utils.js +9 -0
  58. package/dist/components/Portal/utils.js.map +1 -0
  59. package/dist/components/ToastsLayout/ToastsLayout.cjs +2 -2
  60. package/dist/components/Tooltip/Tooltip.cjs +4 -4
  61. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  62. package/dist/components/Tooltip/Tooltip.js +4 -3
  63. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  64. package/dist/components/WeightInput/WeightInput.cjs +10 -9
  65. package/dist/components/WeightInput/WeightInput.cjs.map +1 -1
  66. package/dist/components/WeightInput/WeightInput.js +11 -10
  67. package/dist/components/WeightInput/WeightInput.js.map +1 -1
  68. package/dist/components/WeightInput/index.cjs +10 -0
  69. package/dist/components/WeightInput/index.cjs.map +1 -0
  70. package/dist/components/WeightInput/index.d.ts +2 -1
  71. package/dist/components/WeightInput/index.js +8 -0
  72. package/dist/components/WeightInput/index.js.map +1 -0
  73. package/dist/components/WeightInput/styled.cjs +1 -2
  74. package/dist/components/WeightInput/styled.cjs.map +1 -1
  75. package/dist/components/WeightInput/styled.js +2 -2
  76. package/dist/components/WeightInput/styled.js.map +1 -1
  77. package/dist/index.cjs +12 -12
  78. package/dist/index.js +2 -2
  79. package/package.json +2 -2
@@ -3,27 +3,27 @@
3
3
  var React = require('react');
4
4
  var index$1 = require('../InputGroup/index.cjs');
5
5
  var types = require('../types.cjs');
6
- var withLabels = require('../../hoc/withLabels/withLabels.cjs');
7
6
  var styled = require('./styled.cjs');
8
7
  var CrossIcon = require('../../tempIcons/CrossIcon.cjs');
9
8
  var index = require('../../theme/index.cjs');
10
9
  var blockInvalidCharacters = require('../../utils/blockInvalidCharacters.cjs');
11
10
  var invalidCharactersNumeric = require('../../utils/invalidCharactersNumeric.cjs');
11
+ var InputGroupLabel = require('../InputGroup/components/InputGroupLabel/InputGroupLabel.cjs');
12
12
 
13
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
14
 
15
15
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
16
 
17
17
  const blockInvalidChars = (e) => blockInvalidCharacters.blockInvalidCharacters(e, invalidCharactersNumeric.invalidCharsList);
18
- const DimensionsInput = withLabels.withLabels(({ size = types.ComponentSize.base, handleChangeHeight, handleChangeWidth, handleChangeLength, className, height, width, length, unit, ...rest }) => (React__default.default.createElement(styled.Container, { className: className },
18
+ const DimensionsInput = ({ size = types.ComponentSize.base, handleChangeHeight, handleChangeWidth, handleChangeLength, className, height, width, length, unit = 'cm', ...rest }) => (React__default.default.createElement(styled.Container, { className: className, role: "group", "aria-label": "Dimensions" },
19
19
  React__default.default.createElement(styled.Row, null,
20
- React__default.default.createElement(styled.TextField, { onChange: handleChangeLength, size: size, name: "length", type: "number", placeholder: "L", value: length, min: "0", step: "any", onKeyDown: blockInvalidChars, ...rest }),
21
- React__default.default.createElement(CrossIcon.CrossIcon, { height: index.theme.sizes.base, width: index.theme.sizes.base }),
22
- React__default.default.createElement(styled.TextField, { onChange: handleChangeWidth, size: size, name: "width", type: "number", placeholder: "W", value: width, min: "0", step: "any", onKeyDown: blockInvalidChars, ...rest }),
23
- React__default.default.createElement(CrossIcon.CrossIcon, { height: index.theme.sizes.base, width: index.theme.sizes.base }),
20
+ React__default.default.createElement(styled.TextField, { name: "length", type: "number", value: length, "aria-label": "Length", "aria-describedby": "dimensions-unit", min: "0", step: "any", onChange: handleChangeLength, onKeyDown: blockInvalidChars, size: size, placeholder: "L", ...rest }),
21
+ React__default.default.createElement(CrossIcon.CrossIcon, { height: index.theme.sizes.base, width: index.theme.sizes.base, role: "presentation" }),
22
+ React__default.default.createElement(styled.TextField, { name: "width", type: "number", value: width, "aria-label": "Width", "aria-describedby": "dimensions-unit", min: "0", step: "any", onChange: handleChangeWidth, onKeyDown: blockInvalidChars, size: size, placeholder: "W", ...rest }),
23
+ React__default.default.createElement(CrossIcon.CrossIcon, { height: index.theme.sizes.base, width: index.theme.sizes.base, role: "presentation" }),
24
24
  React__default.default.createElement(index$1.InputGroup, null,
25
- React__default.default.createElement(styled.TextField, { onChange: handleChangeHeight, size: size, name: "height", type: "number", placeholder: "H", value: height, min: "0", step: "any", onKeyDown: blockInvalidChars, ...rest }),
26
- React__default.default.createElement(styled.Button, { size: size }, unit))))));
25
+ React__default.default.createElement(styled.TextField, { name: "height", type: "number", value: height, "aria-label": "Height", "aria-describedby": "dimensions-unit", min: "0", step: "any", onChange: handleChangeHeight, onKeyDown: blockInvalidChars, size: size, placeholder: "H", ...rest }),
26
+ React__default.default.createElement(InputGroupLabel.InputGroupLabel, { size: size, unit: unit, id: "dimensions-unit" })))));
27
27
  DimensionsInput.displayName = 'DimensionsInput';
28
28
 
29
29
  exports.DimensionsInput = DimensionsInput;
@@ -1 +1 @@
1
- {"version":3,"file":"DimensionsInput.cjs","sources":["../../../src/components/DimensionsInput/DimensionsInput.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { InputGroup } from '../InputGroup';\nimport { ComponentSize } from '../types';\nimport { withLabels } from '../../hoc';\n\nimport { Container, Row, TextField, Button } from './styled';\n\nimport { DimensionsProps } from './types';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { theme } from '../../theme';\nimport { blockInvalidCharacters } from '../../utils/blockInvalidCharacters';\nimport { invalidCharsList } from '../../utils/invalidCharactersNumeric';\n\nconst blockInvalidChars = (e: React.KeyboardEvent) => blockInvalidCharacters(e, invalidCharsList);\nexport const DimensionsInput: FC<DimensionsProps> = withLabels(\n ({\n size = ComponentSize.base,\n handleChangeHeight,\n handleChangeWidth,\n handleChangeLength,\n className,\n height,\n width,\n length,\n unit,\n ...rest\n }: DimensionsProps) => (\n <Container className={className}>\n <Row>\n <TextField\n onChange={handleChangeLength}\n size={size}\n name=\"length\"\n type=\"number\"\n placeholder=\"L\"\n value={length}\n min=\"0\"\n step=\"any\"\n onKeyDown={blockInvalidChars}\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} />\n <TextField\n onChange={handleChangeWidth}\n size={size}\n name=\"width\"\n type=\"number\"\n placeholder=\"W\"\n value={width}\n min=\"0\"\n step=\"any\"\n onKeyDown={blockInvalidChars}\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} />\n <InputGroup>\n <TextField\n onChange={handleChangeHeight}\n size={size}\n name=\"height\"\n type=\"number\"\n placeholder=\"H\"\n value={height}\n min=\"0\"\n step=\"any\"\n onKeyDown={blockInvalidChars}\n {...rest}\n />\n <Button size={size}>{unit}</Button>\n </InputGroup>\n </Row>\n </Container>\n ),\n);\n\nDimensionsInput.displayName = 'DimensionsInput';\n"],"names":["blockInvalidCharacters","invalidCharsList","withLabels","ComponentSize","React","Container","Row","TextField","CrossIcon","theme","InputGroup","Button"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAM,iBAAiB,GAAG,CAAC,CAAsB,KAAKA,6CAAsB,CAAC,CAAC,EAAEC,yCAAgB,CAAC;AACpF,MAAA,eAAe,GAAwBC,qBAAU,CAC5D,CAAC,EACC,IAAI,GAAGC,mBAAa,CAAC,IAAI,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,IAAI,EACJ,GAAG,IAAI,EACS,MAChBC,sBAAA,CAAA,aAAA,CAACC,gBAAS,EAAC,EAAA,SAAS,EAAE,SAAS,EAAA;AAC7B,IAAAD,sBAAA,CAAA,aAAA,CAACE,UAAG,EAAA,IAAA;AACF,QAAAF,sBAAA,CAAA,aAAA,CAACG,gBAAS,EACR,EAAA,QAAQ,EAAE,kBAAkB,EAC5B,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,GAAG,EACf,KAAK,EAAE,MAAM,EACb,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,KAAK,EACV,SAAS,EAAE,iBAAiB,EAAA,GACxB,IAAI,EACR,CAAA;AACF,QAAAH,sBAAA,CAAA,aAAA,CAACI,mBAAS,EAAC,EAAA,MAAM,EAAEC,WAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAEA,WAAK,CAAC,KAAK,CAAC,IAAI,EAAI,CAAA;AAChE,QAAAL,sBAAA,CAAA,aAAA,CAACG,gBAAS,EACR,EAAA,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,GAAG,EACf,KAAK,EAAE,KAAK,EACZ,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,KAAK,EACV,SAAS,EAAE,iBAAiB,EAAA,GACxB,IAAI,EACR,CAAA;AACF,QAAAH,sBAAA,CAAA,aAAA,CAACI,mBAAS,EAAC,EAAA,MAAM,EAAEC,WAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAEA,WAAK,CAAC,KAAK,CAAC,IAAI,EAAI,CAAA;AAChE,QAAAL,sBAAA,CAAA,aAAA,CAACM,kBAAU,EAAA,IAAA;AACT,YAAAN,sBAAA,CAAA,aAAA,CAACG,gBAAS,EACR,EAAA,QAAQ,EAAE,kBAAkB,EAC5B,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,GAAG,EACf,KAAK,EAAE,MAAM,EACb,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,KAAK,EACV,SAAS,EAAE,iBAAiB,EAAA,GACxB,IAAI,EACR,CAAA;AACF,YAAAH,sBAAA,CAAA,aAAA,CAACO,aAAM,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA,EAAG,IAAI,CAAU,CACxB,CACT,CACI,CACb;AAGH,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
1
+ {"version":3,"file":"DimensionsInput.cjs","sources":["../../../src/components/DimensionsInput/DimensionsInput.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { InputGroup, InputGroupLabel } from '../InputGroup';\nimport { ComponentSize } from '../types';\n\nimport { Container, Row, TextField } from './styled';\n\nimport { DimensionsProps } from './types';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { theme } from '../../theme';\nimport { blockInvalidCharacters } from '../../utils/blockInvalidCharacters';\nimport { invalidCharsList } from '../../utils/invalidCharactersNumeric';\n\nconst blockInvalidChars = (e: React.KeyboardEvent) => blockInvalidCharacters(e, invalidCharsList);\n\nexport const DimensionsInput: FC<DimensionsProps> = ({\n size = ComponentSize.base,\n handleChangeHeight,\n handleChangeWidth,\n handleChangeLength,\n className,\n height,\n width,\n length,\n unit = 'cm',\n ...rest\n}: DimensionsProps) => (\n <Container className={className} role=\"group\" aria-label=\"Dimensions\">\n <Row>\n <TextField\n name=\"length\"\n type=\"number\"\n value={length}\n aria-label=\"Length\"\n aria-describedby=\"dimensions-unit\"\n min=\"0\"\n step=\"any\"\n onChange={handleChangeLength}\n onKeyDown={blockInvalidChars}\n size={size}\n placeholder=\"L\"\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} role=\"presentation\" />\n <TextField\n name=\"width\"\n type=\"number\"\n value={width}\n aria-label=\"Width\"\n aria-describedby=\"dimensions-unit\"\n min=\"0\"\n step=\"any\"\n onChange={handleChangeWidth}\n onKeyDown={blockInvalidChars}\n size={size}\n placeholder=\"W\"\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} role=\"presentation\" />\n <InputGroup>\n <TextField\n name=\"height\"\n type=\"number\"\n value={height}\n aria-label=\"Height\"\n aria-describedby=\"dimensions-unit\"\n min=\"0\"\n step=\"any\"\n onChange={handleChangeHeight}\n onKeyDown={blockInvalidChars}\n size={size}\n placeholder=\"H\"\n {...rest}\n />\n <InputGroupLabel size={size} unit={unit} id=\"dimensions-unit\" />\n </InputGroup>\n </Row>\n </Container>\n);\n\nDimensionsInput.displayName = 'DimensionsInput';\n"],"names":["blockInvalidCharacters","invalidCharsList","ComponentSize","React","Container","Row","TextField","CrossIcon","theme","InputGroup","InputGroupLabel"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAM,iBAAiB,GAAG,CAAC,CAAsB,KAAKA,6CAAsB,CAAC,CAAC,EAAEC,yCAAgB,CAAC;MAEpF,eAAe,GAAwB,CAAC,EACnD,IAAI,GAAGC,mBAAa,CAAC,IAAI,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB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,IAAI,EAAE,IAAI,EAAC,cAAc,EAAG,CAAA;AACpF,QAAAL,sBAAA,CAAA,aAAA,CAACM,kBAAU,EAAA,IAAA;AACT,YAAAN,sBAAA,CAAA,aAAA,CAACG,gBAAS,EACR,EAAA,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,MAAM,EACF,YAAA,EAAA,QAAQ,sBACF,iBAAiB,EAClC,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,KAAK,EACV,QAAQ,EAAE,kBAAkB,EAC5B,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,IAAI,EACV,WAAW,EAAC,GAAG,EAAA,GACX,IAAI,EACR,CAAA;AACF,YAAAH,sBAAA,CAAA,aAAA,CAACO,+BAAe,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAC,iBAAiB,EAAA,CAAG,CACrD,CACT,CACI;AAGd,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
@@ -1,23 +1,23 @@
1
1
  import React from 'react';
2
2
  import { InputGroup } from '../InputGroup/index.js';
3
3
  import { ComponentSize } from '../types.js';
4
- import { withLabels } from '../../hoc/withLabels/withLabels.js';
5
- import { Container, Row, TextField as StyledTextField, Button as StyledButton } from './styled.js';
4
+ import { Container, Row, TextField as StyledTextField } from './styled.js';
6
5
  import { CrossIcon } from '../../tempIcons/CrossIcon.js';
7
6
  import { theme } from '../../theme/index.js';
8
7
  import { blockInvalidCharacters } from '../../utils/blockInvalidCharacters.js';
9
8
  import { invalidCharsList } from '../../utils/invalidCharactersNumeric.js';
9
+ import { InputGroupLabel } from '../InputGroup/components/InputGroupLabel/InputGroupLabel.js';
10
10
 
11
11
  const blockInvalidChars = (e) => blockInvalidCharacters(e, invalidCharsList);
12
- const DimensionsInput = withLabels(({ size = ComponentSize.base, handleChangeHeight, handleChangeWidth, handleChangeLength, className, height, width, length, unit, ...rest }) => (React.createElement(Container, { className: className },
12
+ const DimensionsInput = ({ size = ComponentSize.base, handleChangeHeight, handleChangeWidth, handleChangeLength, className, height, width, length, unit = 'cm', ...rest }) => (React.createElement(Container, { className: className, role: "group", "aria-label": "Dimensions" },
13
13
  React.createElement(Row, null,
14
- React.createElement(StyledTextField, { onChange: handleChangeLength, size: size, name: "length", type: "number", placeholder: "L", value: length, min: "0", step: "any", onKeyDown: blockInvalidChars, ...rest }),
15
- React.createElement(CrossIcon, { height: theme.sizes.base, width: theme.sizes.base }),
16
- React.createElement(StyledTextField, { onChange: handleChangeWidth, size: size, name: "width", type: "number", placeholder: "W", value: width, min: "0", step: "any", onKeyDown: blockInvalidChars, ...rest }),
17
- React.createElement(CrossIcon, { height: theme.sizes.base, width: theme.sizes.base }),
14
+ React.createElement(StyledTextField, { name: "length", type: "number", value: length, "aria-label": "Length", "aria-describedby": "dimensions-unit", min: "0", step: "any", onChange: handleChangeLength, onKeyDown: blockInvalidChars, size: size, placeholder: "L", ...rest }),
15
+ React.createElement(CrossIcon, { height: theme.sizes.base, width: theme.sizes.base, role: "presentation" }),
16
+ React.createElement(StyledTextField, { name: "width", type: "number", value: width, "aria-label": "Width", "aria-describedby": "dimensions-unit", min: "0", step: "any", onChange: handleChangeWidth, onKeyDown: blockInvalidChars, size: size, placeholder: "W", ...rest }),
17
+ React.createElement(CrossIcon, { height: theme.sizes.base, width: theme.sizes.base, role: "presentation" }),
18
18
  React.createElement(InputGroup, null,
19
- React.createElement(StyledTextField, { onChange: handleChangeHeight, size: size, name: "height", type: "number", placeholder: "H", value: height, min: "0", step: "any", onKeyDown: blockInvalidChars, ...rest }),
20
- React.createElement(StyledButton, { size: size }, unit))))));
19
+ React.createElement(StyledTextField, { name: "height", type: "number", value: height, "aria-label": "Height", "aria-describedby": "dimensions-unit", min: "0", step: "any", onChange: handleChangeHeight, onKeyDown: blockInvalidChars, size: size, placeholder: "H", ...rest }),
20
+ React.createElement(InputGroupLabel, { size: size, unit: unit, id: "dimensions-unit" })))));
21
21
  DimensionsInput.displayName = 'DimensionsInput';
22
22
 
23
23
  export { DimensionsInput };
@@ -1 +1 @@
1
- {"version":3,"file":"DimensionsInput.js","sources":["../../../src/components/DimensionsInput/DimensionsInput.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { InputGroup } from '../InputGroup';\nimport { ComponentSize } from '../types';\nimport { withLabels } from '../../hoc';\n\nimport { Container, Row, TextField, Button } from './styled';\n\nimport { DimensionsProps } from './types';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { theme } from '../../theme';\nimport { blockInvalidCharacters } from '../../utils/blockInvalidCharacters';\nimport { invalidCharsList } from '../../utils/invalidCharactersNumeric';\n\nconst blockInvalidChars = (e: React.KeyboardEvent) => blockInvalidCharacters(e, invalidCharsList);\nexport const DimensionsInput: FC<DimensionsProps> = withLabels(\n ({\n size = ComponentSize.base,\n handleChangeHeight,\n handleChangeWidth,\n handleChangeLength,\n className,\n height,\n width,\n length,\n unit,\n ...rest\n }: DimensionsProps) => (\n <Container className={className}>\n <Row>\n <TextField\n onChange={handleChangeLength}\n size={size}\n name=\"length\"\n type=\"number\"\n placeholder=\"L\"\n value={length}\n min=\"0\"\n step=\"any\"\n onKeyDown={blockInvalidChars}\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} />\n <TextField\n onChange={handleChangeWidth}\n size={size}\n name=\"width\"\n type=\"number\"\n placeholder=\"W\"\n value={width}\n min=\"0\"\n step=\"any\"\n onKeyDown={blockInvalidChars}\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} />\n <InputGroup>\n <TextField\n onChange={handleChangeHeight}\n size={size}\n name=\"height\"\n type=\"number\"\n placeholder=\"H\"\n value={height}\n min=\"0\"\n step=\"any\"\n onKeyDown={blockInvalidChars}\n {...rest}\n />\n <Button size={size}>{unit}</Button>\n </InputGroup>\n </Row>\n </Container>\n ),\n);\n\nDimensionsInput.displayName = 'DimensionsInput';\n"],"names":["TextField","Button"],"mappings":";;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KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAI,CAAA;AAChE,QAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,IAAA;AACT,YAAA,KAAA,CAAA,aAAA,CAACA,eAAS,EACR,EAAA,QAAQ,EAAE,kBAAkB,EAC5B,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,GAAG,EACf,KAAK,EAAE,MAAM,EACb,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,KAAK,EACV,SAAS,EAAE,iBAAiB,EAAA,GACxB,IAAI,EACR,CAAA;AACF,YAAA,KAAA,CAAA,aAAA,CAACC,YAAM,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA,EAAG,IAAI,CAAU,CACxB,CACT,CACI,CACb;AAGH,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
1
+ {"version":3,"file":"DimensionsInput.js","sources":["../../../src/components/DimensionsInput/DimensionsInput.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { InputGroup, InputGroupLabel } from '../InputGroup';\nimport { ComponentSize } from '../types';\n\nimport { Container, Row, TextField } from './styled';\n\nimport { DimensionsProps } from './types';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { theme } from '../../theme';\nimport { blockInvalidCharacters } from '../../utils/blockInvalidCharacters';\nimport { invalidCharsList } from '../../utils/invalidCharactersNumeric';\n\nconst blockInvalidChars = (e: React.KeyboardEvent) => blockInvalidCharacters(e, invalidCharsList);\n\nexport const DimensionsInput: FC<DimensionsProps> = ({\n size = ComponentSize.base,\n handleChangeHeight,\n handleChangeWidth,\n handleChangeLength,\n className,\n height,\n width,\n length,\n unit = 'cm',\n ...rest\n}: DimensionsProps) => (\n <Container className={className} role=\"group\" aria-label=\"Dimensions\">\n <Row>\n <TextField\n name=\"length\"\n type=\"number\"\n value={length}\n aria-label=\"Length\"\n aria-describedby=\"dimensions-unit\"\n min=\"0\"\n step=\"any\"\n onChange={handleChangeLength}\n onKeyDown={blockInvalidChars}\n size={size}\n placeholder=\"L\"\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} role=\"presentation\" />\n <TextField\n name=\"width\"\n type=\"number\"\n value={width}\n aria-label=\"Width\"\n aria-describedby=\"dimensions-unit\"\n min=\"0\"\n step=\"any\"\n onChange={handleChangeWidth}\n onKeyDown={blockInvalidChars}\n size={size}\n placeholder=\"W\"\n {...rest}\n />\n <CrossIcon height={theme.sizes.base} width={theme.sizes.base} role=\"presentation\" />\n <InputGroup>\n <TextField\n name=\"height\"\n type=\"number\"\n value={height}\n aria-label=\"Height\"\n aria-describedby=\"dimensions-unit\"\n min=\"0\"\n step=\"any\"\n onChange={handleChangeHeight}\n onKeyDown={blockInvalidChars}\n size={size}\n placeholder=\"H\"\n {...rest}\n />\n <InputGroupLabel size={size} unit={unit} id=\"dimensions-unit\" />\n </InputGroup>\n </Row>\n </Container>\n);\n\nDimensionsInput.displayName = 'DimensionsInput';\n"],"names":["TextField"],"mappings":";;;;;;;;;;AAaA,MAAM,iBAAiB,GAAG,CAAC,CAAsB,KAAK,sBAAsB,CAAC,CAAC,EAAE,gBAAgB,CAAC;MAEpF,eAAe,GAAwB,CAAC,EACnD,IAAI,GAAG,aAAa,CAAC,IAAI,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,IAAI,GAAG,IAAI,EACX,GAAG,IAAI,EACS,MAChB,oBAAC,SAAS,EAAA,EAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAC,OAAO,EAAA,YAAA,EAAY,YAAY,EAAA;AACnE,IAAA,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,IAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAACA,eAAS,EACR,EAAA,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,Q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AAI,EAAE,IAAI,EACV,WAAW,EAAC,GAAG,EAAA,GACX,IAAI,EACR,CAAA;AACF,YAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAC,iBAAiB,EAAA,CAAG,CACrD,CACT,CACI;AAGd,eAAe,CAAC,WAAW,GAAG,iBAAiB;;;;"}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var withLabels = require('../../hoc/withLabels/withLabels.cjs');
4
+ require('react');
5
+ var DimensionsInput$1 = require('./DimensionsInput.cjs');
6
+
7
+ const DimensionsInput = withLabels.withLabels(DimensionsInput$1.DimensionsInput);
8
+
9
+ exports.DimensionsInput = DimensionsInput;
10
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/DimensionsInput/index.ts"],"sourcesContent":["import { withLabels } from '../../hoc';\nimport { DimensionsInput as BaseDimensionsInput } from './DimensionsInput';\n\nexport const DimensionsInput = withLabels(BaseDimensionsInput);\n"],"names":["withLabels","BaseDimensionsInput"],"mappings":";;;;;;MAGa,eAAe,GAAGA,qBAAU,CAACC,iCAAmB;;;;"}
@@ -1 +1,2 @@
1
- export { DimensionsInput } from './DimensionsInput';
1
+ /// <reference types="react" />
2
+ export declare const DimensionsInput: import("react").FC<import("./types").DimensionsProps & import("../../hoc/withLabels/withLabels").WithLabelsProps>;
@@ -0,0 +1,8 @@
1
+ import { withLabels } from '../../hoc/withLabels/withLabels.js';
2
+ import 'react';
3
+ import { DimensionsInput as DimensionsInput$1 } from './DimensionsInput.js';
4
+
5
+ const DimensionsInput = withLabels(DimensionsInput$1);
6
+
7
+ export { DimensionsInput };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/DimensionsInput/index.ts"],"sourcesContent":["import { withLabels } from '../../hoc';\nimport { DimensionsInput as BaseDimensionsInput } from './DimensionsInput';\n\nexport const DimensionsInput = withLabels(BaseDimensionsInput);\n"],"names":["BaseDimensionsInput"],"mappings":";;;;MAGa,eAAe,GAAG,UAAU,CAACA,iBAAmB;;;;"}
@@ -1,9 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var styled = require('styled-components');
4
- var Text = require('../Text/Text.cjs');
5
4
  var index = require('../TextField/index.cjs');
6
- var Button = require('../Button/Button.cjs');
7
5
  var BaseContainer = require('../BaseContainer/BaseContainer.cjs');
8
6
  var index$1 = require('../../theme/index.cjs');
9
7
 
@@ -14,12 +12,9 @@ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
14
12
  const Container = styled__default.default(BaseContainer.BaseContainer).withConfig({ displayName: "vui--Container", componentId: "vui--oxhxoy" }) `display:flex;flex-direction:column;position:relative;`;
15
13
  const Row = styled__default.default(BaseContainer.BaseContainer).withConfig({ displayName: "vui--Row", componentId: "vui--w9sg63" }) `display:flex;align-items:center;margin-top:4px;gap:8px;`;
16
14
  const StyledTextField = styled__default.default(index.TextField).withConfig({ displayName: "vui--StyledTextField", componentId: "vui--1dp86fg" }) `width:52px;margin:0;padding:0 6px;&&&{text-align:left;border-color:${index$1.theme.colors.neutral.ink.lightest};}`;
17
- const StyledButton = styled__default.default(Button.Button).withConfig({ displayName: "vui--StyledButton", componentId: "vui--1h9einl" }) `padding:0 6px;border-color:${index$1.theme.colors.neutral.ink.lightest};`;
18
- styled__default.default(Text.Text).withConfig({ displayName: "vui--Label", componentId: "vui--2iwwsg" }) ``;
19
- styled__default.default.span.withConfig({ displayName: "vui--Error", componentId: "vui--1ln478r" }) `display:block;font-family:${index$1.theme.text.error.fontFamily};font-size:${index$1.theme.text.error.fontSize};font-weight:${index$1.theme.text.error.fontWeight};line-height:${index$1.theme.text.error.lineHeight};color:${index$1.theme.text.error.color};&::before{content:'';position:absolute;top:0;bottom:0;left:calc(${index$1.theme.sizes[2]} * -1);width:2px;background-color:${index$1.theme.colors.secondary.red.base};}`;
20
- styled__default.default.span.withConfig({ displayName: "vui--Hint", componentId: "vui--5lfadq" }) `display:block;font-family:${index$1.theme.fontFamily};font-size:${index$1.theme.sizes[3]};line-height:${index$1.theme.sizes[4]};color:${index$1.theme.colors.neutral.ink.light};`;
15
+ styled__default.default.span.withConfig({ displayName: "vui--Error", componentId: "vui--1isax7l" }) `display:block;font-family:${index$1.theme.text.error.fontFamily};font-size:${index$1.theme.text.error.fontSize};font-weight:${index$1.theme.text.error.fontWeight};line-height:${index$1.theme.text.error.lineHeight};color:${index$1.theme.text.error.color};&::before{content:'';position:absolute;top:0;bottom:0;left:calc(${index$1.theme.sizes[2]} * -1);width:2px;background-color:${index$1.theme.colors.secondary.red.base};}`;
16
+ styled__default.default.span.withConfig({ displayName: "vui--Hint", componentId: "vui--gorpke" }) `display:block;font-family:${index$1.theme.fontFamily};font-size:${index$1.theme.sizes[3]};line-height:${index$1.theme.sizes[4]};color:${index$1.theme.colors.neutral.ink.light};`;
21
17
 
22
- exports.Button = StyledButton;
23
18
  exports.Container = Container;
24
19
  exports.Row = Row;
25
20
  exports.TextField = StyledTextField;
@@ -1 +1 @@
1
- {"version":3,"file":"styled.cjs","sources":["../../../src/components/DimensionsInput/styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { Text } from '../Text';\nimport { TextField } from '../TextField';\nimport { Button } from '../Button';\nimport { BaseContainer } from '../BaseContainer';\nimport { theme } from '../../theme';\n\nconst Container = styled(BaseContainer)`\n display: flex;\n flex-direction: column;\n position: relative;\n`;\n\nconst Row = styled(BaseContainer)`\n display: flex;\n align-items: center;\n margin-top: 4px;\n\n gap: 8px;\n`;\n\nconst StyledTextField = styled(TextField)`\n width: 52px;\n margin: 0;\n padding: 0 6px;\n\n &&& {\n text-align: left;\n border-color: ${theme.colors.neutral.ink.lightest};\n }\n`;\n\nconst StyledButton = styled(Button)`\n padding: 0 6px;\n border-color: ${theme.colors.neutral.ink.lightest};\n`;\n\nconst Label = styled(Text)``;\n\nconst Error = styled.span`\n display: block;\n font-family: ${theme.text.error.fontFamily};\n font-size: ${theme.text.error.fontSize};\n font-weight: ${theme.text.error.fontWeight};\n line-height: ${theme.text.error.lineHeight};\n color: ${theme.text.error.color};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(${theme.sizes[2]} * -1);\n width: 2px;\n background-color: ${theme.colors.secondary.red.base};\n }\n`;\n\nconst Hint = styled.span`\n display: block;\n font-family: ${theme.fontFamily};\n font-size: ${theme.sizes[3]};\n line-height: ${theme.sizes[4]};\n color: ${theme.colors.neutral.ink.light};\n`;\n\nexport { Container, Row, Error, Hint, StyledTextField as TextField, StyledButton as Button, Label };\n"],"names":["styled","BaseContainer","TextField","theme","Button","Text"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,SAAS,GAAGA,uBAAM,CAACC,2BAAa,CAAC;AAMvC,MAAM,GAAG,GAAGD,uBAAM,CAACC,2BAAa,CAAC;AAQjC,MAAM,eAAe,GAAGD,uBAAM,CAACE,eAAS,CAAC,CAOrB,UAAA,CAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,mEAAA,EAAAC,aAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ;AAIrD,MAAM,YAAY,GAAGH,uBAAM,CAACI,aAAM,CAAC,CAEjB,UAAA,CAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,2BAAA,EAAAD,aAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ;AAGrCH,uBAAM,CAACK,SAAI,CAAC;AAEZL,uBAAM,CAAC,IAAI,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAERG,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAA,WAAA,EAC7BA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA,aAAA,EACvBA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAC3B,aAAA,EAAAA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CACjC,OAAA,EAAAA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,oEAOhBA,aAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAEP,kCAAA,EAAAA,aAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;AAI1CH,uBAAM,CAAC,IAAI,CAEP,UAAA,CAAA,EAAA,WAAA,EAAA,WAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAAAG,aAAK,CAAC,UAAU,cAClBA,aAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,aAAA,EACZA,aAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UACpBA,aAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;;;;;;;"}
1
+ {"version":3,"file":"styled.cjs","sources":["../../../src/components/DimensionsInput/styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { TextField } from '../TextField';\nimport { BaseContainer } from '../BaseContainer';\nimport { theme } from '../../theme';\n\nconst Container = styled(BaseContainer)`\n display: flex;\n flex-direction: column;\n position: relative;\n`;\n\nconst Row = styled(BaseContainer)`\n display: flex;\n align-items: center;\n margin-top: 4px;\n\n gap: 8px;\n`;\n\nconst StyledTextField = styled(TextField)`\n width: 52px;\n margin: 0;\n padding: 0 6px;\n\n &&& {\n text-align: left;\n border-color: ${theme.colors.neutral.ink.lightest};\n }\n`;\n\nconst Error = styled.span`\n display: block;\n font-family: ${theme.text.error.fontFamily};\n font-size: ${theme.text.error.fontSize};\n font-weight: ${theme.text.error.fontWeight};\n line-height: ${theme.text.error.lineHeight};\n color: ${theme.text.error.color};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(${theme.sizes[2]} * -1);\n width: 2px;\n background-color: ${theme.colors.secondary.red.base};\n }\n`;\n\nconst Hint = styled.span`\n display: block;\n font-family: ${theme.fontFamily};\n font-size: ${theme.sizes[3]};\n line-height: ${theme.sizes[4]};\n color: ${theme.colors.neutral.ink.light};\n`;\n\nexport { Container, Row, Error, Hint, StyledTextField as TextField };\n"],"names":["styled","BaseContainer","TextField","theme"],"mappings":";;;;;;;;;;;AAMA,MAAM,SAAS,GAAGA,uBAAM,CAACC,2BAAa,CAAC;AAMvC,MAAM,GAAG,GAAGD,uBAAM,CAACC,2BAAa,CAAC;AAQjC,MAAM,eAAe,GAAGD,uBAAM,CAACE,eAAS,CAAC,CAOrB,UAAA,CAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,mEAAA,EAAAC,aAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ;AAIvCH,uBAAM,CAAC,IAAI,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAERG,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAA,WAAA,EAC7BA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA,aAAA,EACvBA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAC3B,aAAA,EAAAA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CACjC,OAAA,EAAAA,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,oEAOhBA,aAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAEP,kCAAA,EAAAA,aAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;AAI1CH,uBAAM,CAAC,IAAI,CAEP,UAAA,CAAA,EAAA,WAAA,EAAA,WAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAAAG,aAAK,CAAC,UAAU,cAClBA,aAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,aAAA,EACZA,aAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UACpBA,aAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;;;;;;"}
@@ -303,16 +303,6 @@ declare const StyledTextField: import("styled-components").StyledComponent<impor
303
303
  size?: "base" | "sm" | undefined;
304
304
  multiline?: boolean | undefined;
305
305
  } & import("react").RefAttributes<HTMLInputElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps>, any, {}, never>;
306
- declare const StyledButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
307
- children?: import("react").ReactNode;
308
- variant?: import("../Button/types").ButtonVariant | undefined;
309
- size?: "base" | "sm" | undefined;
310
- iconSlot?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
311
- dropdown?: boolean | undefined;
312
- loading?: boolean | undefined;
313
- contentStyles?: import("react").CSSProperties | undefined;
314
- } & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
315
- declare const Label: import("styled-components").StyledComponent<"span", any, {} & import("../Text/types").TextProps, never>;
316
306
  declare const Error: import("styled-components").StyledComponent<"span", any, {}, never>;
317
307
  declare const Hint: import("styled-components").StyledComponent<"span", any, {}, never>;
318
- export { Container, Row, Error, Hint, StyledTextField as TextField, StyledButton as Button, Label };
308
+ export { Container, Row, Error, Hint, StyledTextField as TextField };
@@ -1,17 +1,13 @@
1
1
  import styled from 'styled-components';
2
- import { Text } from '../Text/Text.js';
3
2
  import { TextField } from '../TextField/index.js';
4
- import { Button } from '../Button/Button.js';
5
3
  import { BaseContainer } from '../BaseContainer/BaseContainer.js';
6
4
  import { theme } from '../../theme/index.js';
7
5
 
8
6
  const Container = styled(BaseContainer).withConfig({ displayName: "vui--Container", componentId: "vui--oxhxoy" }) `display:flex;flex-direction:column;position:relative;`;
9
7
  const Row = styled(BaseContainer).withConfig({ displayName: "vui--Row", componentId: "vui--w9sg63" }) `display:flex;align-items:center;margin-top:4px;gap:8px;`;
10
8
  const StyledTextField = styled(TextField).withConfig({ displayName: "vui--StyledTextField", componentId: "vui--1dp86fg" }) `width:52px;margin:0;padding:0 6px;&&&{text-align:left;border-color:${theme.colors.neutral.ink.lightest};}`;
11
- const StyledButton = styled(Button).withConfig({ displayName: "vui--StyledButton", componentId: "vui--1h9einl" }) `padding:0 6px;border-color:${theme.colors.neutral.ink.lightest};`;
12
- styled(Text).withConfig({ displayName: "vui--Label", componentId: "vui--2iwwsg" }) ``;
13
- styled.span.withConfig({ displayName: "vui--Error", componentId: "vui--1ln478r" }) `display:block;font-family:${theme.text.error.fontFamily};font-size:${theme.text.error.fontSize};font-weight:${theme.text.error.fontWeight};line-height:${theme.text.error.lineHeight};color:${theme.text.error.color};&::before{content:'';position:absolute;top:0;bottom:0;left:calc(${theme.sizes[2]} * -1);width:2px;background-color:${theme.colors.secondary.red.base};}`;
14
- styled.span.withConfig({ displayName: "vui--Hint", componentId: "vui--5lfadq" }) `display:block;font-family:${theme.fontFamily};font-size:${theme.sizes[3]};line-height:${theme.sizes[4]};color:${theme.colors.neutral.ink.light};`;
9
+ styled.span.withConfig({ displayName: "vui--Error", componentId: "vui--1isax7l" }) `display:block;font-family:${theme.text.error.fontFamily};font-size:${theme.text.error.fontSize};font-weight:${theme.text.error.fontWeight};line-height:${theme.text.error.lineHeight};color:${theme.text.error.color};&::before{content:'';position:absolute;top:0;bottom:0;left:calc(${theme.sizes[2]} * -1);width:2px;background-color:${theme.colors.secondary.red.base};}`;
10
+ styled.span.withConfig({ displayName: "vui--Hint", componentId: "vui--gorpke" }) `display:block;font-family:${theme.fontFamily};font-size:${theme.sizes[3]};line-height:${theme.sizes[4]};color:${theme.colors.neutral.ink.light};`;
15
11
 
16
- export { StyledButton as Button, Container, Row, StyledTextField as TextField };
12
+ export { Container, Row, StyledTextField as TextField };
17
13
  //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../src/components/DimensionsInput/styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { Text } from '../Text';\nimport { TextField } from '../TextField';\nimport { Button } from '../Button';\nimport { BaseContainer } from '../BaseContainer';\nimport { theme } from '../../theme';\n\nconst Container = styled(BaseContainer)`\n display: flex;\n flex-direction: column;\n position: relative;\n`;\n\nconst Row = styled(BaseContainer)`\n display: flex;\n align-items: center;\n margin-top: 4px;\n\n gap: 8px;\n`;\n\nconst StyledTextField = styled(TextField)`\n width: 52px;\n margin: 0;\n padding: 0 6px;\n\n &&& {\n text-align: left;\n border-color: ${theme.colors.neutral.ink.lightest};\n }\n`;\n\nconst StyledButton = styled(Button)`\n padding: 0 6px;\n border-color: ${theme.colors.neutral.ink.lightest};\n`;\n\nconst Label = styled(Text)``;\n\nconst Error = styled.span`\n display: block;\n font-family: ${theme.text.error.fontFamily};\n font-size: ${theme.text.error.fontSize};\n font-weight: ${theme.text.error.fontWeight};\n line-height: ${theme.text.error.lineHeight};\n color: ${theme.text.error.color};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(${theme.sizes[2]} * -1);\n width: 2px;\n background-color: ${theme.colors.secondary.red.base};\n }\n`;\n\nconst Hint = styled.span`\n display: block;\n font-family: ${theme.fontFamily};\n font-size: ${theme.sizes[3]};\n line-height: ${theme.sizes[4]};\n color: ${theme.colors.neutral.ink.light};\n`;\n\nexport { Container, Row, Error, Hint, StyledTextField as TextField, StyledButton as Button, Label };\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC;AAMvC,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC;AAQjC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAOrB,UAAA,CA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+ {"version":3,"file":"styled.js","sources":["../../../src/components/DimensionsInput/styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { TextField } from '../TextField';\nimport { BaseContainer } from '../BaseContainer';\nimport { theme } from '../../theme';\n\nconst Container = styled(BaseContainer)`\n display: flex;\n flex-direction: column;\n position: relative;\n`;\n\nconst Row = styled(BaseContainer)`\n display: flex;\n align-items: center;\n margin-top: 4px;\n\n gap: 8px;\n`;\n\nconst StyledTextField = styled(TextField)`\n width: 52px;\n margin: 0;\n padding: 0 6px;\n\n &&& {\n text-align: left;\n border-color: ${theme.colors.neutral.ink.lightest};\n }\n`;\n\nconst Error = styled.span`\n display: block;\n font-family: ${theme.text.error.fontFamily};\n font-size: ${theme.text.error.fontSize};\n font-weight: ${theme.text.error.fontWeight};\n line-height: ${theme.text.error.lineHeight};\n color: ${theme.text.error.color};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(${theme.sizes[2]} * -1);\n width: 2px;\n background-color: ${theme.colors.secondary.red.base};\n }\n`;\n\nconst Hint = styled.span`\n display: block;\n font-family: ${theme.fontFamily};\n font-size: ${theme.sizes[3]};\n line-height: ${theme.sizes[4]};\n color: ${theme.colors.neutral.ink.light};\n`;\n\nexport { Container, Row, Error, Hint, StyledTextField as TextField };\n"],"names":[],"mappings":";;;;;AAMA,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC;AAMvC,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC;AAQjC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,CAOrB,UAAA,CAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,mEAAA,EAAA,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ;AAIvC,MAAM,CAAC,IAAI,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAER,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAA,WAAA,EAC7B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA,aAAA,EACvB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAC3B,aAAA,EAAA,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CACjC,OAAA,EAAA,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,oEAOhB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAEP,kCAAA,EAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;AAI1C,MAAM,CAAC,IAAI,CAEP,UAAA,CAAA,EAAA,WAAA,EAAA,WAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAAA,KAAK,CAAC,UAAU,cAClB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,aAAA,EACZ,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UACpB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;;;;"}
@@ -1,15 +1,12 @@
1
1
  import { ComponentSize } from '../types';
2
- export interface DimensionsProps {
2
+ export type DimensionsProps = {
3
3
  size?: ComponentSize;
4
4
  handleChangeHeight: (value: string) => void;
5
5
  handleChangeWidth: (value: string) => void;
6
6
  handleChangeLength: (value: string) => void;
7
- label?: string;
8
- hint?: string;
9
- error?: string;
10
7
  height: string;
11
8
  width: string;
12
9
  length: string;
13
10
  unit?: string;
14
11
  className?: string;
15
- }
12
+ };
@@ -2,7 +2,7 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactPopper = require('react-popper');
5
- var ReactDOM = require('react-dom');
5
+ var reactDom = require('react-dom');
6
6
  var PlaceholderImage = require('./components/PlaceholderImage.cjs');
7
7
  var styled = require('./components/styled.cjs');
8
8
  var utils = require('./utils.cjs');
@@ -41,7 +41,7 @@ const Image = ({ src, alt = '', className, e2eClassName, width, height, previewW
41
41
  isImageHidden &&
42
42
  (placeholder || (React__default.default.createElement(PlaceholderImage.PlaceholderImage, { className: buildClassnames.buildClassnames([classNames === null || classNames === undefined ? undefined : classNames.placeholder, e2eClassNames === null || e2eClassNames === undefined ? undefined : e2eClassNames.placeholder]), width: placeholderWidth || width, height: placeholderHeight || height }))),
43
43
  isPreviewOpen &&
44
- ReactDOM.createPortal(React__default.default.createElement(styled.PreviewImageContainer, { ref: setPopperElement, style: styles.popper, ...attributes.popper, className: buildClassnames.buildClassnames([
44
+ reactDom.createPortal(React__default.default.createElement(styled.PreviewImageContainer, { ref: setPopperElement, style: styles.popper, ...attributes.popper, className: buildClassnames.buildClassnames([
45
45
  classNames === null || classNames === undefined ? undefined : classNames.previewImageContainer,
46
46
  e2eClassNames === null || e2eClassNames === undefined ? undefined : e2eClassNames.previewImageContainer,
47
47
  ]) },
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var Text = require('../../../Text/Text.cjs');
5
+ var styled = require('./styled.cjs');
6
+
7
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
+
11
+ const InputGroupLabel = ({ id, unit, size }) => (React__default.default.createElement(styled.GroupLabelWrapper, { size: size },
12
+ React__default.default.createElement(Text.Text, { variant: "body", id: id }, unit)));
13
+
14
+ exports.InputGroupLabel = InputGroupLabel;
15
+ //# sourceMappingURL=InputGroupLabel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputGroupLabel.cjs","sources":["../../../../../src/components/InputGroup/components/InputGroupLabel/InputGroupLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { ComponentSize } from 'src/components/types';\nimport { Text } from '../../../Text';\nimport { GroupLabelWrapper } from './styled';\n\ntype InputGroupLabelProps = {\n id?: string;\n unit: string;\n size: ComponentSize;\n};\n\nexport const InputGroupLabel = ({ id, unit, size }: InputGroupLabelProps) => (\n <GroupLabelWrapper size={size}>\n <Text variant=\"body\" id={id}>\n {unit}\n </Text>\n </GroupLabelWrapper>\n);\n"],"names":["React","GroupLabelWrapper","Text"],"mappings":";;;;;;;;;;MAWa,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAwB,MACtEA,qCAACC,wBAAiB,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA;AAC3B,IAAAD,sBAAA,CAAA,aAAA,CAACE,SAAI,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,EAAE,EACxB,EAAA,IAAI,CACA,CACW;;;;"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ComponentSize } from 'src/components/types';
3
+ type InputGroupLabelProps = {
4
+ id?: string;
5
+ unit: string;
6
+ size: ComponentSize;
7
+ };
8
+ export declare const InputGroupLabel: ({ id, unit, size }: InputGroupLabelProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Text } from '../../../Text/Text.js';
3
+ import { GroupLabelWrapper } from './styled.js';
4
+
5
+ const InputGroupLabel = ({ id, unit, size }) => (React.createElement(GroupLabelWrapper, { size: size },
6
+ React.createElement(Text, { variant: "body", id: id }, unit)));
7
+
8
+ export { InputGroupLabel };
9
+ //# sourceMappingURL=InputGroupLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputGroupLabel.js","sources":["../../../../../src/components/InputGroup/components/InputGroupLabel/InputGroupLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { ComponentSize } from 'src/components/types';\nimport { Text } from '../../../Text';\nimport { GroupLabelWrapper } from './styled';\n\ntype InputGroupLabelProps = {\n id?: string;\n unit: string;\n size: ComponentSize;\n};\n\nexport const InputGroupLabel = ({ id, unit, size }: InputGroupLabelProps) => (\n <GroupLabelWrapper size={size}>\n <Text variant=\"body\" id={id}>\n {unit}\n </Text>\n </GroupLabelWrapper>\n);\n"],"names":[],"mappings":";;;;MAWa,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAwB,MACtE,oBAAC,iBAAiB,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA;AAC3B,IAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,EAAE,EAAE,EAAE,EACxB,EAAA,IAAI,CACA,CACW;;;;"}
@@ -0,0 +1 @@
1
+ export { InputGroupLabel } from './InputGroupLabel';
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var styled = require('styled-components');
4
+ var index = require('../../../../theme/index.cjs');
5
+
6
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
7
+
8
+ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
9
+
10
+ const GroupLabelWrapper = styled__default.default.div.withConfig({ displayName: "vui--GroupLabelWrapper", componentId: "vui--1nbjbcg" }) `display:flex;align-items:center;padding:0 6px;border:1px solid;border-color:${index.theme.colors.neutral.ink.lightest};border-radius:${index.theme.radius.base};`;
11
+
12
+ exports.GroupLabelWrapper = GroupLabelWrapper;
13
+ //# sourceMappingURL=styled.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.cjs","sources":["../../../../../src/components/InputGroup/components/InputGroupLabel/styled.ts"],"sourcesContent":["import { ComponentSize } from 'src/components/types';\nimport styled from 'styled-components';\nimport { theme } from 'Theme';\n\nexport const GroupLabelWrapper = styled.div<{ size: ComponentSize }>`\n display: flex;\n align-items: center;\n\n padding: 0 6px;\n\n border: 1px solid;\n border-color: ${theme.colors.neutral.ink.lightest};\n border-radius: ${theme.radius.base};\n`;\n"],"names":["styled","theme"],"mappings":";;;;;;;;;AAIa,MAAA,iBAAiB,GAAGA,uBAAM,CAAC,GAAG,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,wBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,4EAAA,EAOzBC,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAChC,eAAA,EAAAA,WAAK,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA;;;;"}
@@ -0,0 +1,4 @@
1
+ import { ComponentSize } from 'src/components/types';
2
+ export declare const GroupLabelWrapper: import("styled-components").StyledComponent<"div", any, {
3
+ size: ComponentSize;
4
+ }, never>;
@@ -0,0 +1,7 @@
1
+ import styled from 'styled-components';
2
+ import { theme } from '../../../../theme/index.js';
3
+
4
+ const GroupLabelWrapper = styled.div.withConfig({ displayName: "vui--GroupLabelWrapper", componentId: "vui--1nbjbcg" }) `display:flex;align-items:center;padding:0 6px;border:1px solid;border-color:${theme.colors.neutral.ink.lightest};border-radius:${theme.radius.base};`;
5
+
6
+ export { GroupLabelWrapper };
7
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.js","sources":["../../../../../src/components/InputGroup/components/InputGroupLabel/styled.ts"],"sourcesContent":["import { ComponentSize } from 'src/components/types';\nimport styled from 'styled-components';\nimport { theme } from 'Theme';\n\nexport const GroupLabelWrapper = styled.div<{ size: ComponentSize }>`\n display: flex;\n align-items: center;\n\n padding: 0 6px;\n\n border: 1px solid;\n border-color: ${theme.colors.neutral.ink.lightest};\n border-radius: ${theme.radius.base};\n`;\n"],"names":[],"mappings":";;;AAIa,MAAA,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,wBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,4EAAA,EAOzB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAChC,eAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA;;;;"}
@@ -1,12 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var styled = require('styled-components');
4
+ require('react');
5
+ require('../Text/Text.cjs');
6
+ require('./components/InputGroupLabel/styled.cjs');
4
7
 
5
8
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
6
9
 
7
10
  var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
8
11
 
9
- const InputGroup = styled__default.default.div.withConfig({ displayName: "vui--InputGroup", componentId: "vui--1w0e9jz" }) `display:flex;& > *{margin-left:0;margin-right:0;box-shadow:none;}& > *:not(:last-child){border-right-width:0 !important;}& > *:hover{}& > *:focus,& > *:active{z-index:5;border-right-width:1px !important;}& > *:focus + *,& > *:active + *{border-left-width:0 !important;}& > *:not(:first-child):not(:last-child){border-top-left-radius:0 !important;border-top-right-radius:0 !important;border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:first-child{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:last-child{border-top-left-radius:0 !important;border-bottom-left-radius:0 !important;}`;
12
+ const InputGroup = styled__default.default.div.withConfig({ displayName: "vui--InputGroup", componentId: "vui--1w0e9jz" }) `display:flex;& > *{margin-left:0;margin-right:0;box-shadow:none;}& > *:not(:last-child){border-right-width:0 !important;}& > *:focus,& > *:active{z-index:5;}& > *:not(:first-child):not(:last-child){border-top-left-radius:0 !important;border-top-right-radius:0 !important;border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:first-child{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:last-child{border-top-left-radius:0 !important;border-bottom-left-radius:0 !important;}`;
10
13
 
11
14
  exports.InputGroup = InputGroup;
12
15
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/InputGroup/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const InputGroup = styled.div`\n display: flex;\n\n & > * {\n margin-left: 0;\n margin-right: 0;\n box-shadow: none;\n }\n\n & > *:not(:last-child) {\n border-right-width: 0 !important;\n }\n\n & > *:hover {\n }\n\n & > *:focus,\n & > *:active {\n z-index: 5;\n border-right-width: 1px !important;\n }\n\n & > *:focus + *,\n & > *:active + * {\n border-left-width: 0 !important;\n }\n\n & > *:not(:first-child):not(:last-child) {\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:first-child {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:last-child {\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n }\n`;\n"],"names":["styled"],"mappings":";;;;;;;;MAEa,UAAU,GAAGA,uBAAM,CAAC,GAAG;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/InputGroup/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport { InputGroupLabel } from './components/InputGroupLabel';\n\nexport const InputGroup = styled.div`\n display: flex;\n\n & > * {\n margin-left: 0;\n margin-right: 0;\n box-shadow: none;\n }\n\n & > *:not(:last-child) {\n border-right-width: 0 !important;\n }\n\n & > *:focus,\n & > *:active {\n z-index: 5;\n }\n\n & > *:not(:first-child):not(:last-child) {\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:first-child {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:last-child {\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n }\n`;\n"],"names":["styled"],"mappings":";;;;;;;;;;;MAIa,UAAU,GAAGA,uBAAM,CAAC,GAAG;;;;"}
@@ -1 +1,2 @@
1
+ export { InputGroupLabel } from './components/InputGroupLabel';
1
2
  export declare const InputGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,6 +1,9 @@
1
1
  import styled from 'styled-components';
2
+ import 'react';
3
+ import '../Text/Text.js';
4
+ import './components/InputGroupLabel/styled.js';
2
5
 
3
- const InputGroup = styled.div.withConfig({ displayName: "vui--InputGroup", componentId: "vui--1w0e9jz" }) `display:flex;& > *{margin-left:0;margin-right:0;box-shadow:none;}& > *:not(:last-child){border-right-width:0 !important;}& > *:hover{}& > *:focus,& > *:active{z-index:5;border-right-width:1px !important;}& > *:focus + *,& > *:active + *{border-left-width:0 !important;}& > *:not(:first-child):not(:last-child){border-top-left-radius:0 !important;border-top-right-radius:0 !important;border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:first-child{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:last-child{border-top-left-radius:0 !important;border-bottom-left-radius:0 !important;}`;
6
+ const InputGroup = styled.div.withConfig({ displayName: "vui--InputGroup", componentId: "vui--1w0e9jz" }) `display:flex;& > *{margin-left:0;margin-right:0;box-shadow:none;}& > *:not(:last-child){border-right-width:0 !important;}& > *:focus,& > *:active{z-index:5;}& > *:not(:first-child):not(:last-child){border-top-left-radius:0 !important;border-top-right-radius:0 !important;border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:first-child{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;}& > *:last-child{border-top-left-radius:0 !important;border-bottom-left-radius:0 !important;}`;
4
7
 
5
8
  export { InputGroup };
6
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/InputGroup/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const InputGroup = styled.div`\n display: flex;\n\n & > * {\n margin-left: 0;\n margin-right: 0;\n box-shadow: none;\n }\n\n & > *:not(:last-child) {\n border-right-width: 0 !important;\n }\n\n & > *:hover {\n }\n\n & > *:focus,\n & > *:active {\n z-index: 5;\n border-right-width: 1px !important;\n }\n\n & > *:focus + *,\n & > *:active + * {\n border-left-width: 0 !important;\n }\n\n & > *:not(:first-child):not(:last-child) {\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:first-child {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:last-child {\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n }\n`;\n"],"names":[],"mappings":";;MAEa,UAAU,GAAG,MAAM,CAAC,GAAG;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/InputGroup/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport { InputGroupLabel } from './components/InputGroupLabel';\n\nexport const InputGroup = styled.div`\n display: flex;\n\n & > * {\n margin-left: 0;\n margin-right: 0;\n box-shadow: none;\n }\n\n & > *:not(:last-child) {\n border-right-width: 0 !important;\n }\n\n & > *:focus,\n & > *:active {\n z-index: 5;\n }\n\n & > *:not(:first-child):not(:last-child) {\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:first-child {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n & > *:last-child {\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n }\n`;\n"],"names":[],"mappings":";;;;;MAIa,UAAU,GAAG,MAAM,CAAC,GAAG;;;;"}
@@ -10,6 +10,7 @@ var Button = require('../Button/Button.cjs');
10
10
  var Card = require('../Card/Card.cjs');
11
11
  var CardHeader = require('../CardHeader/CardHeader.cjs');
12
12
  var Stack = require('../Stack/Stack.cjs');
13
+ var utils = require('./utils.cjs');
13
14
 
14
15
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
15
16
 
@@ -17,7 +18,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
17
18
 
18
19
  /* eslint-disable react/destructuring-assignment */
19
20
  const Modal = (props) => {
20
- const { shouldShow, showHeaderCloseButton = true, fullBleed = false, variant = 'base', onClose: parentOnClose, children, className, } = props;
21
+ const { shouldShow, showHeaderCloseButton = true, preventClose = false, fullBleed = false, variant = 'base', onClose: parentOnClose, children, className, } = props;
21
22
  const modalRef = React.useRef(null);
22
23
  const [mainSectionRef, setMainSectionRef] = React.useState(null);
23
24
  React.useEffect(() => {
@@ -35,7 +36,7 @@ const Modal = (props) => {
35
36
  };
36
37
  return (React__default.default.createElement(framerMotion.AnimatePresence, null, shouldShow && (React__default.default.createElement("div", { "data-testid": "dialog-wrapper" },
37
38
  React__default.default.createElement(styled.NonScrollableBody, null),
38
- React__default.default.createElement(Dialog.Dialog, { ref: modalRef, onClose: onClose, variant: variant, "aria-describedby": "modal_title", className: className },
39
+ React__default.default.createElement(Dialog.Dialog, { ref: modalRef, onClose: onClose, onKeyDown: preventClose ? utils.preventDefaultEventOnESC : undefined, variant: variant, "aria-describedby": "modal_title", className: className },
39
40
  React__default.default.createElement(Card.Card.Surface, null,
40
41
  types.hasHeaderSlot(props) ? (props.headerSlot) : (React__default.default.createElement(CardHeader.CardHeader, { id: "modal_title", headerVariant: "headingLarge", title: props.headerTitle, subtitle: props.headerSubtitle, ...(showHeaderCloseButton && { onClickClose: onClose }) })),
41
42
  React__default.default.createElement(styled.MainSection, { onScroll: onScroll, ref: setMainSectionRef, isScrollable: isContentOverflowing, fullBleed: fullBleed }, children),
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.cjs","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { useEffect, useRef, useState } from 'react';\nimport { AnimatePresence } from 'framer-motion';\n\nimport { MainSection, NonScrollableBody } from './components/styled';\nimport { ModalProps, hasFooterSlot, hasHeaderSlot } from './types';\nimport { Dialog } from './components/Dialog/Dialog';\n\nimport { useIsOverflowing } from '../../hooks/useIsOverflowing';\nimport { Button } from '../Button';\nimport { Card } from '../Card';\nimport { CardHeader } from '../CardHeader';\nimport { Stack } from '../Stack';\n\nexport const Modal = (props: ModalProps) => {\n const {\n shouldShow,\n showHeaderCloseButton = true,\n fullBleed = false,\n variant = 'base',\n onClose: parentOnClose,\n children,\n className,\n } = props;\n\n const modalRef = useRef<HTMLDialogElement | null>(null);\n const [mainSectionRef, setMainSectionRef] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n if (shouldShow) {\n modalRef.current?.removeAttribute('open'); // Allows for conditional rendering.\n modalRef.current?.showModal();\n }\n }, [shouldShow]);\n\n const { isOverflowing: isContentOverflowing, onScroll } = useIsOverflowing(mainSectionRef);\n\n const onClose = () => {\n modalRef.current?.close();\n parentOnClose();\n };\n\n return (\n <AnimatePresence>\n {shouldShow && (\n <div data-testid=\"dialog-wrapper\">\n <NonScrollableBody />\n <Dialog\n ref={modalRef}\n onClose={onClose}\n variant={variant}\n aria-describedby=\"modal_title\"\n className={className}\n >\n <Card.Surface>\n {hasHeaderSlot(props) ? (\n props.headerSlot\n ) : (\n <CardHeader\n id=\"modal_title\"\n headerVariant=\"headingLarge\"\n title={props.headerTitle}\n subtitle={props.headerSubtitle}\n {...(showHeaderCloseButton && { onClickClose: onClose })}\n />\n )}\n\n <MainSection\n onScroll={onScroll}\n ref={setMainSectionRef}\n isScrollable={isContentOverflowing}\n fullBleed={fullBleed}\n >\n {children}\n </MainSection>\n\n {hasFooterSlot(props) && props.footerSlot}\n\n {!hasFooterSlot(props) && (props.leftActions || props.rightActions) && (\n <Card.Footer>\n <Stack direction=\"horizontal\" alignX={props.leftActions ? 'between' : 'end'}>\n {props.leftActions && (\n <Stack\n direction=\"horizontal\"\n alignX=\"start\"\n data-testid=\"left-actions-container\"\n >\n {props.leftActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" {...actionProps}>\n {label}\n </Button>\n ))}\n </Stack>\n )}\n {props.rightActions && (\n <Stack\n direction=\"horizontal\"\n alignX=\"end\"\n data-testid=\"right-actions-container\"\n >\n {props.rightActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" {...actionProps}>\n {label}\n </Button>\n ))}\n </Stack>\n )}\n </Stack>\n </Card.Footer>\n )}\n </Card.Surface>\n </Dialog>\n </div>\n )}\n </AnimatePresence>\n );\n};\n"],"names":["useRef","useState","useEffect","useIsOverflowing","React","AnimatePresence","NonScrollableBody","Dialog","Card","hasHeaderSlot","CardHeader","MainSection","hasFooterSlot","Stack","Button"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAca,MAAA,KAAK,GAAG,CAAC,KAAiB,KAAI;IACzC,MAAM,EACJ,UAAU,EACV,qBAAqB,GAAG,IAAI,EAC5B,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,QAAQ,EACR,SAAS,GACV,GAAG,KAAK;AAET,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAA2B,IAAI,CAAC;IACvD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAGC,cAAQ,CAAqB,IAAI,CAAC;IAE9EC,eAAS,CAAC,MAAK;;AACb,QAAA,IAAI,UAAU,EAAE;YACd,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,eAAe,CAAC,MAAM,CAAC,CAAC;AAC1C,YAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,SAAS,EAAE;AAC9B;AACH,KAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AAEhB,IAAA,MAAM,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAGC,iCAAgB,CAAC,cAAc,CAAC;IAE1F,MAAM,OAAO,GAAG,MAAK;;AACnB,QAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,KAAK,EAAE;AACzB,QAAA,aAAa,EAAE;AACjB,KAAC;IAED,QACEC,qCAACC,4BAAe,E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BAAA,CAAA,aAAA,CAACS,WAAK,EACJ,EAAA,SAAS,EAAC,YAAY,EACtB,MAAM,EAAC,OAAO,EAAA,aAAA,EACF,wBAAwB,EAAA,EAEnC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MAC/CT,sBAAC,CAAA,aAAA,CAAAU,aAAM,EAAC,EAAA,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAA,GAAK,WAAW,EAAA,EAC9C,KAAK,CACC,CACV,CAAC,CACI,CACT;AACA,wBAAA,KAAK,CAAC,YAAY,KACjBV,sBAAC,CAAA,aAAA,CAAAS,WAAK,EACJ,EAAA,SAAS,EAAC,YAAY,EACtB,MAAM,EAAC,KAAK,EACA,aAAA,EAAA,yBAAyB,EAEpC,EAAA,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MAChDT,sBAAA,CAAA,aAAA,CAACU,aAAM,EAAA,EAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAA,GAAK,WAAW,EAAA,EAC9C,KAAK,CACC,CACV,CAAC,CACI,CACT,CACK,CACI,CACf,CACY,CACR,CACL,CACP,CACe;AAEtB;;;;"}
1
+ {"version":3,"file":"Modal.cjs","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { useEffect, useRef, useState } from 'react';\nimport { AnimatePresence } from 'framer-motion';\n\nimport { MainSection, NonScrollableBody } from './components/styled';\nimport { ModalProps, hasFooterSlot, hasHeaderSlot } from './types';\nimport { Dialog } from './components/Dialog/Dialog';\n\nimport { useIsOverflowing } from '../../hooks/useIsOverflowing';\nimport { Button } from '../Button';\nimport { Card } from '../Card';\nimport { CardHeader } from '../CardHeader';\nimport { Stack } from '../Stack';\nimport { preventDefaultEventOnESC } from './utils';\n\nexport const Modal = (props: ModalProps) => {\n const {\n shouldShow,\n showHeaderCloseButton = true,\n preventClose = false,\n fullBleed = false,\n variant = 'base',\n onClose: parentOnClose,\n children,\n className,\n } = props;\n\n const modalRef = useRef<HTMLDialogElement | null>(null);\n const [mainSectionRef, setMainSectionRef] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n if (shouldShow) {\n modalRef.current?.removeAttribute('open'); // Allows for conditional rendering.\n modalRef.current?.showModal();\n }\n }, [shouldShow]);\n\n const { isOverflowing: isContentOverflowing, onScroll } = useIsOverflowing(mainSectionRef);\n\n const onClose = () => {\n modalRef.current?.close();\n parentOnClose();\n };\n\n return (\n <AnimatePresence>\n {shouldShow && (\n <div data-testid=\"dialog-wrapper\">\n <NonScrollableBody />\n <Dialog\n ref={modalRef}\n onClose={onClose}\n onKeyDown={preventClose ? preventDefaultEventOnESC : undefined}\n variant={variant}\n aria-describedby=\"modal_title\"\n className={className}\n >\n <Card.Surface>\n {hasHeaderSlot(props) ? (\n props.headerSlot\n ) : (\n <CardHeader\n id=\"modal_title\"\n headerVariant=\"headingLarge\"\n title={props.headerTitle}\n subtitle={props.headerSubtitle}\n {...(showHeaderCloseButton && { onClickClose: onClose })}\n />\n )}\n\n <MainSection\n onScroll={onScroll}\n ref={setMainSectionRef}\n isScrollable={isContentOverflowing}\n fullBleed={fullBleed}\n >\n {children}\n </MainSection>\n\n {hasFooterSlot(props) && props.footerSlot}\n\n {!hasFooterSlot(props) && (props.leftActions || props.rightActions) && (\n <Card.Footer>\n <Stack direction=\"horizontal\" alignX={props.leftActions ? 'between' : 'end'}>\n {props.leftActions && (\n <Stack\n direction=\"horizontal\"\n alignX=\"start\"\n data-testid=\"left-actions-container\"\n >\n {props.leftActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" {...actionProps}>\n {label}\n </Button>\n ))}\n </Stack>\n )}\n {props.rightActions && (\n <Stack\n direction=\"horizontal\"\n alignX=\"end\"\n data-testid=\"right-actions-container\"\n >\n {props.rightActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" {...actionProps}>\n {label}\n </Button>\n ))}\n </Stack>\n )}\n </Stack>\n </Card.Footer>\n )}\n </Card.Surface>\n </Dialog>\n </div>\n )}\n </AnimatePresence>\n );\n};\n"],"names":["useRef","useState","useEffect","useIsOverflowing","React","AnimatePresence","NonScrollableBody","Dialog","preventDefaultEventOnESC","Card","hasHeaderSlot","CardHeader","MainSection","hasFooterSlot","Stack","Button"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAea,MAAA,KAAK,GAAG,CAAC,KAAiB,KAAI;AACzC,IAAA,MAAM,EACJ,UAAU,EACV,qBAAqB,GAAG,IAAI,EAC5B,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,QAAQ,EACR,SAAS,GACV,GAAG,KAAK;AAET,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAA2B,IAAI,CAAC;IACvD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAGC,cAAQ,CAAqB,IAAI,CAAC;IAE9EC,eAAS,CAAC,MAAK;;AACb,QAAA,IAAI,UAAU,EAAE;YACd,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,eAAe,CAAC,MAAM,CAAC,CAAC;AAC1C,YAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,SAAS,EAAE;AAC9B;AACH,KAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AAEhB,IAAA,MAAM,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAGC,iCAAgB,CAAC,cAAc,CAAC;IAE1F,MAAM,OAAO,GAAG,MAAK;;AACnB,QAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAE,I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,EAAA,IAAA;AACV,oBAAAL,sBAAA,CAAA,aAAA,CAACU,WAAK,EAAC,EAAA,SAAS,EAAC,YAAY,EAAC,MAAM,EAAE,KAAK,CAAC,WAAW,GAAG,SAAS,GAAG,KAAK,EAAA;wBACxE,KAAK,CAAC,WAAW,KAChBV,sBAAA,CAAA,aAAA,CAACU,WAAK,EACJ,EAAA,SAAS,EAAC,YAAY,EACtB,MAAM,EAAC,OAAO,EAAA,aAAA,EACF,wBAAwB,EAAA,EAEnC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MAC/CV,sBAAC,CAAA,aAAA,CAAAW,aAAM,EAAC,EAAA,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAA,GAAK,WAAW,EAAA,EAC9C,KAAK,CACC,CACV,CAAC,CACI,CACT;AACA,wBAAA,KAAK,CAAC,YAAY,KACjBX,sBAAC,CAAA,aAAA,CAAAU,WAAK,EACJ,EAAA,SAAS,EAAC,YAAY,EACtB,MAAM,EAAC,KAAK,EACA,aAAA,EAAA,yBAAyB,EAEpC,EAAA,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MAChDV,sBAAA,CAAA,aAAA,CAACW,aAAM,EAAA,EAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAA,GAAK,WAAW,EAAA,EAC9C,KAAK,CACC,CACV,CAAC,CACI,CACT,CACK,CACI,CACf,CACY,CACR,CACL,CACP,CACe;AAEtB;;;;"}
@@ -8,10 +8,11 @@ import { Button } from '../Button/Button.js';
8
8
  import { Card } from '../Card/Card.js';
9
9
  import { CardHeader } from '../CardHeader/CardHeader.js';
10
10
  import { Stack } from '../Stack/Stack.js';
11
+ import { preventDefaultEventOnESC } from './utils.js';
11
12
 
12
13
  /* eslint-disable react/destructuring-assignment */
13
14
  const Modal = (props) => {
14
- const { shouldShow, showHeaderCloseButton = true, fullBleed = false, variant = 'base', onClose: parentOnClose, children, className, } = props;
15
+ const { shouldShow, showHeaderCloseButton = true, preventClose = false, fullBleed = false, variant = 'base', onClose: parentOnClose, children, className, } = props;
15
16
  const modalRef = useRef(null);
16
17
  const [mainSectionRef, setMainSectionRef] = useState(null);
17
18
  useEffect(() => {
@@ -29,7 +30,7 @@ const Modal = (props) => {
29
30
  };
30
31
  return (React.createElement(AnimatePresence, null, shouldShow && (React.createElement("div", { "data-testid": "dialog-wrapper" },
31
32
  React.createElement(NonScrollableBody, null),
32
- React.createElement(Dialog, { ref: modalRef, onClose: onClose, variant: variant, "aria-describedby": "modal_title", className: className },
33
+ React.createElement(Dialog, { ref: modalRef, onClose: onClose, onKeyDown: preventClose ? preventDefaultEventOnESC : undefined, variant: variant, "aria-describedby": "modal_title", className: className },
33
34
  React.createElement(Card.Surface, null,
34
35
  hasHeaderSlot(props) ? (props.headerSlot) : (React.createElement(CardHeader, { id: "modal_title", headerVariant: "headingLarge", title: props.headerTitle, subtitle: props.headerSubtitle, ...(showHeaderCloseButton && { onClickClose: onClose }) })),
35
36
  React.createElement(MainSection, { onScroll: onScroll, ref: setMainSectionRef, isScrollable: isContentOverflowing, fullBleed: fullBleed }, children),