jvetrau-ds 0.2.7 → 0.2.8

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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var button = require('./button');
4
- var input = require('./input/input');
4
+ var input = require('./input');
5
5
  var textarea = require('./textarea/textarea');
6
6
  var select = require('./select/select');
7
7
  var dropdown = require('./dropdown/dropdown');
@@ -1,8 +1,8 @@
1
1
  export { default as Button } from './button';
2
2
  export { buttonLink, } from './button';
3
3
  export type { ButtonProps, } from './button';
4
- export { default as Input } from './input/input';
5
- export type { InputProps } from './input/input';
4
+ export { default as Input, } from './input';
5
+ export type { InputProps, InputWidth, } from './input';
6
6
  export { default as Textarea } from './textarea/textarea';
7
7
  export type { TextareaProps } from './textarea/textarea';
8
8
  export { default as Select } from './select/select';
@@ -1,5 +1,5 @@
1
1
  export { default as Button, buttonLink } from './button';
2
- export { default as Input } from './input/input';
2
+ export { default as Input } from './input';
3
3
  export { default as Textarea } from './textarea/textarea';
4
4
  export { default as Select } from './select/select';
5
5
  export { default as Dropdown } from './dropdown/dropdown';
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var input = require('./input');
4
6
 
5
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -8,6 +10,13 @@ var input__default = /*#__PURE__*/_interopDefault(input);
8
10
 
9
11
 
10
12
 
11
- module.exports = input__default.default;
13
+ Object.defineProperty(exports, "Input", {
14
+ enumerable: true,
15
+ get: function () { return input.Input; }
16
+ });
17
+ Object.defineProperty(exports, "default", {
18
+ enumerable: true,
19
+ get: function () { return input__default.default; }
20
+ });
12
21
  //# sourceMappingURL=index.cjs.map
13
22
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- export { default } from './input';
2
- export type { InputProps } from './input';
1
+ export { default, Input, } from './input';
2
+ export type { InputProps, InputWidth, } from './input';
@@ -1,3 +1,3 @@
1
- export { default } from './input';
1
+ export { Input, default } from './input';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,17 +1,23 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var jsxRuntime = require('react/jsx-runtime');
4
6
  var classnames = require('../helpers/classnames');
5
7
 
6
8
  const Input = ({
7
9
  state = "default",
10
+ width = "default",
8
11
  className = "",
9
12
  disabled = false,
10
13
  ...props
11
14
  }) => {
12
15
  const classes = classnames.classnames("input", className, {
13
- error: state === "error",
14
- success: state === "success"
16
+ "input--error": state === "error",
17
+ "input--success": state === "success",
18
+ "input--width-short": width === "short",
19
+ "input--width-default": width === "default",
20
+ "input--width-max": width === "max"
15
21
  });
16
22
  return /* @__PURE__ */ jsxRuntime.jsx(
17
23
  "input",
@@ -24,6 +30,7 @@ const Input = ({
24
30
  };
25
31
  var input_default = Input;
26
32
 
27
- module.exports = input_default;
33
+ exports.Input = Input;
34
+ exports.default = input_default;
28
35
  //# sourceMappingURL=input.cjs.map
29
36
  //# sourceMappingURL=input.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/input/input.tsx"],"names":["classnames","jsx"],"mappings":";;;;;AASA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA,CAAW,OAAA,EAAS,SAAA,EAAW;AAAA,IAC7C,OAAO,KAAA,KAAU,OAAA;AAAA,IACjB,SAAS,KAAA,KAAU;AAAA,GACpB,CAAA;AAED,EAAA,uBACEC,cAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAA;AAAA,MACX,QAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"input.cjs","sourcesContent":["import React from 'react';\n//import './input.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n state?: 'default' | 'error' | 'success';\n}\n\nconst Input: React.FC<InputProps> = ({\n state = 'default',\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames('input', className, {\n error: state === 'error',\n success: state === 'success',\n });\n\n return (\n <input\n className={classes}\n disabled={disabled}\n {...props}\n />\n );\n};\n\nexport default Input;"]}
1
+ {"version":3,"sources":["../../../src/components/input/input.tsx"],"names":["classnames","jsx"],"mappings":";;;;;;;AAWO,MAAM,QAA8B,CAAC;AAAA,EAC1C,KAAA,GAAQ,SAAA;AAAA,EACR,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAUA,qBAAA,CAAW,OAAA,EAAS,SAAA,EAAW;AAAA,IAC7C,gBAAgB,KAAA,KAAU,OAAA;AAAA,IAC1B,kBAAkB,KAAA,KAAU,SAAA;AAAA,IAC5B,sBAAsB,KAAA,KAAU,OAAA;AAAA,IAChC,wBAAwB,KAAA,KAAU,SAAA;AAAA,IAClC,oBAAoB,KAAA,KAAU;AAAA,GAC/B,CAAA;AAED,EAAA,uBACEC,cAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAA;AAAA,MACX,QAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,IAAO,aAAA,GAAQ","file":"input.cjs","sourcesContent":["import React from 'react';\nimport { classnames } from '../helpers/classnames';\n\nexport type InputWidth = 'short' | 'default' | 'max';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n state?: 'default' | 'error' | 'success';\n width?: InputWidth;\n}\n\nexport const Input: React.FC<InputProps> = ({\n state = 'default',\n width = 'default',\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames('input', className, {\n 'input--error': state === 'error',\n 'input--success': state === 'success',\n 'input--width-short': width === 'short',\n 'input--width-default': width === 'default',\n 'input--width-max': width === 'max',\n });\n\n return (\n <input\n className={classes}\n disabled={disabled}\n {...props}\n />\n );\n};\n\nexport default Input;\n"]}
@@ -25,6 +25,7 @@
25
25
  --input-height: var(--size-control-height);
26
26
  --input-padding-x: var(--padding-control-horz);
27
27
 
28
+ box-sizing: border-box;
28
29
  height: var(--input-height);
29
30
  padding-inline: var(--input-padding-x);
30
31
 
@@ -53,6 +54,21 @@
53
54
  background-color var(--input-transition-duration) ease;
54
55
  }
55
56
 
57
+ .input--width-short {
58
+ /* size */
59
+ width: auto;
60
+ }
61
+
62
+ .input--width-default {
63
+ /* size */
64
+ width: 400px;
65
+ }
66
+
67
+ .input--width-max {
68
+ /* size */
69
+ width: 100%;
70
+ }
71
+
56
72
  .input::placeholder {
57
73
  color: var(--input-placeholder);
58
74
  }
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
+ export type InputWidth = 'short' | 'default' | 'max';
2
3
  export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
4
  state?: 'default' | 'error' | 'success';
5
+ width?: InputWidth;
4
6
  }
5
- declare const Input: React.FC<InputProps>;
7
+ export declare const Input: React.FC<InputProps>;
6
8
  export default Input;
@@ -3,13 +3,17 @@ import { classnames } from '../helpers/classnames';
3
3
 
4
4
  const Input = ({
5
5
  state = "default",
6
+ width = "default",
6
7
  className = "",
7
8
  disabled = false,
8
9
  ...props
9
10
  }) => {
10
11
  const classes = classnames("input", className, {
11
- error: state === "error",
12
- success: state === "success"
12
+ "input--error": state === "error",
13
+ "input--success": state === "success",
14
+ "input--width-short": width === "short",
15
+ "input--width-default": width === "default",
16
+ "input--width-max": width === "max"
13
17
  });
14
18
  return /* @__PURE__ */ jsx(
15
19
  "input",
@@ -22,6 +26,6 @@ const Input = ({
22
26
  };
23
27
  var input_default = Input;
24
28
 
25
- export { input_default as default };
29
+ export { Input, input_default as default };
26
30
  //# sourceMappingURL=input.js.map
27
31
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":";;;AASA,MAAM,QAA8B,CAAC;AAAA,EACnC,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA,CAAW,OAAA,EAAS,SAAA,EAAW;AAAA,IAC7C,OAAO,KAAA,KAAU,OAAA;AAAA,IACjB,SAAS,KAAA,KAAU;AAAA,GACpB,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAA;AAAA,MACX,QAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"input.js","sourcesContent":["import React from 'react';\n//import './input.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n state?: 'default' | 'error' | 'success';\n}\n\nconst Input: React.FC<InputProps> = ({\n state = 'default',\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames('input', className, {\n error: state === 'error',\n success: state === 'success',\n });\n\n return (\n <input\n className={classes}\n disabled={disabled}\n {...props}\n />\n );\n};\n\nexport default Input;"]}
1
+ {"version":3,"sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":";;;AAWO,MAAM,QAA8B,CAAC;AAAA,EAC1C,KAAA,GAAQ,SAAA;AAAA,EACR,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA,GAAY,EAAA;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,OAAA,GAAU,UAAA,CAAW,OAAA,EAAS,SAAA,EAAW;AAAA,IAC7C,gBAAgB,KAAA,KAAU,OAAA;AAAA,IAC1B,kBAAkB,KAAA,KAAU,SAAA;AAAA,IAC5B,sBAAsB,KAAA,KAAU,OAAA;AAAA,IAChC,wBAAwB,KAAA,KAAU,SAAA;AAAA,IAClC,oBAAoB,KAAA,KAAU;AAAA,GAC/B,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAA;AAAA,MACX,QAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,IAAO,aAAA,GAAQ","file":"input.js","sourcesContent":["import React from 'react';\nimport { classnames } from '../helpers/classnames';\n\nexport type InputWidth = 'short' | 'default' | 'max';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n state?: 'default' | 'error' | 'success';\n width?: InputWidth;\n}\n\nexport const Input: React.FC<InputProps> = ({\n state = 'default',\n width = 'default',\n className = '',\n disabled = false,\n ...props\n}) => {\n const classes = classnames('input', className, {\n 'input--error': state === 'error',\n 'input--success': state === 'success',\n 'input--width-short': width === 'short',\n 'input--width-default': width === 'default',\n 'input--width-max': width === 'max',\n });\n\n return (\n <input\n className={classes}\n disabled={disabled}\n {...props}\n />\n );\n};\n\nexport default Input;\n"]}
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  export { default as Button, buttonLink, } from './components/button';
6
6
  export type { ButtonProps, } from './components/button';
7
7
  export { default as Input } from './components/input';
8
- export type { InputProps } from './components/input';
8
+ export type { InputProps, InputWidth, } from './components/input';
9
9
  export { default as Textarea } from './components/textarea';
10
10
  export type { TextareaProps } from './components/textarea';
11
11
  export { default as Select } from './components/select';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jvetrau-ds",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Multi-brand React design system with semantic tokens",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/styles.css CHANGED
@@ -3133,6 +3133,7 @@
3133
3133
  --input-height: var(--size-control-height);
3134
3134
  --input-padding-x: var(--padding-control-horz);
3135
3135
 
3136
+ box-sizing: border-box;
3136
3137
  height: var(--input-height);
3137
3138
  padding-inline: var(--input-padding-x);
3138
3139
 
@@ -3161,6 +3162,21 @@
3161
3162
  background-color var(--input-transition-duration) ease;
3162
3163
  }
3163
3164
 
3165
+ .input--width-short {
3166
+ /* size */
3167
+ width: auto;
3168
+ }
3169
+
3170
+ .input--width-default {
3171
+ /* size */
3172
+ width: 400px;
3173
+ }
3174
+
3175
+ .input--width-max {
3176
+ /* size */
3177
+ width: 100%;
3178
+ }
3179
+
3164
3180
  .input::placeholder {
3165
3181
  color: var(--input-placeholder);
3166
3182
  }