@dktunited-techoff/techoff-suite-ui 1.5.0 → 1.5.2

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,11 +1,10 @@
1
1
  .ts-input {
2
2
  position: relative;
3
3
  width: 100%;
4
- height: 32px;
5
4
  }
6
5
  input {
7
6
  width: 100%;
8
- height: 100%;
7
+ height: 32px;
9
8
  padding: 0 10px;
10
9
  border: 1px solid #949494;
11
10
  font-weight: 600;
@@ -19,6 +18,13 @@ input:focus {
19
18
  .ts-input--padding-1 input {
20
19
  padding: 0 30px 0 10px;
21
20
  }
21
+ /* ####### */
22
+ /* LABEL */
23
+ .ts-input-label {
24
+ padding-bottom: 6px;
25
+ }
26
+ /* ###### */
27
+ /* ICON */
22
28
  .ts-input-icon {
23
29
  position: absolute;
24
30
  top: 0;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { TsInputProps } from './TsInput.types';
3
3
  import './TsInput.css';
4
- export declare const TsInput: ({ icon, value, onChange, ...props }: TsInputProps) => React.JSX.Element;
4
+ export declare const TsInput: ({ icon, label, value, onChange, ...props }: TsInputProps) => React.JSX.Element;
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { TsIcon } from '../../TsIcon/TsIcon';
3
3
  import './TsInput.css';
4
- export const TsInput = ({ icon, value, onChange, ...props }) => {
4
+ export const TsInput = ({ icon, label, value, onChange, ...props }) => {
5
5
  // #########
6
6
  // Rendering
7
7
  return (React.createElement("div", { className: `ts-input ${icon ? 'ts-input--padding-1' : ''}` },
8
+ label && React.createElement("div", { className: "ts-input-label" }, label),
8
9
  React.createElement("input", { type: "text", value: value, onChange: e => onChange(e.target.value), ...props }),
9
10
  icon && (React.createElement("div", { className: "ts-input-icon" },
10
11
  React.createElement(TsIcon, { name: icon, size: "16" })))));
@@ -1 +1 @@
1
- {"version":3,"file":"TsInput.js","sourceRoot":"","sources":["../../../../src/components/TsInput/TsInput/TsInput.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AgB,IAAE,KAAK,CAAO;QACvD,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAM,KAAK,GAAI;QACtF,IAAI,IAAI,CACP,6BAAK,SAAS,EAAC,eAAe;YAC5B,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,GAAG,CAC5B,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -3,11 +3,12 @@ import { TsIcon } from '../../TsIcon/TsIcon';
3
3
  import { TsInputProps } from './TsInput.types';
4
4
  import './TsInput.css';
5
5
 
6
- export const TsInput = ({ icon, value, onChange, ...props }: TsInputProps) => {
6
+ export const TsInput = ({ icon, label, value, onChange, ...props }: TsInputProps) => {
7
7
  // #########
8
8
  // Rendering
9
9
  return (
10
10
  <div className={`ts-input ${icon ? 'ts-input--padding-1' : ''}`}>
11
+ {label && <div className="ts-input-label">{label}</div>}
11
12
  <input type="text" value={value} onChange={e => onChange(e.target.value)} {...props} />
12
13
  {icon && (
13
14
  <div className="ts-input-icon">
@@ -1,5 +1,6 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  export type TsInputProps = {
3
3
  icon?: string;
4
+ label?: string;
4
5
  onChange: (value: string) => void;
5
6
  } & Omit<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>, 'size'>;
@@ -2,5 +2,6 @@ import { InputHTMLAttributes } from 'react';
2
2
 
3
3
  export type TsInputProps = {
4
4
  icon?: string;
5
+ label?: string;
5
6
  onChange: (value: string) => void;
6
7
  } & Omit<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>, 'size'>;
@@ -9,11 +9,15 @@ export const inputArgTypes = {
9
9
  icon: {
10
10
  control: 'select',
11
11
  options: Object.keys(icons),
12
- description: 'Icon of the button.',
12
+ description: 'Icon of the input.',
13
+ },
14
+ label: {
15
+ control: 'text',
16
+ description: 'label of the input.',
13
17
  },
14
18
  placeholder: {
15
19
  control: 'text',
16
- description: 'Placeholder of the button.',
20
+ description: 'Placeholder of the input.',
17
21
  },
18
22
  };
19
23
 
@@ -24,7 +28,11 @@ Input allows the user to enter content and data when the expected user input is
24
28
  ## Overview
25
29
 
26
30
  <Canvas>
27
- <Story name="Overview" args={{ onChange: () => {} }} argTypes={inputArgTypes}>
31
+ <Story
32
+ name="Overview"
33
+ args={{ label: '', placeholder: 'Enter some text', onChange: () => {} }}
34
+ argTypes={inputArgTypes}
35
+ >
28
36
  {args => <TsInput {...args} />}
29
37
  </Story>
30
38
  </Canvas>
@@ -1,11 +1,10 @@
1
1
  .ts-input {
2
2
  position: relative;
3
3
  width: 100%;
4
- height: 32px;
5
4
  }
6
5
  input {
7
6
  width: 100%;
8
- height: 100%;
7
+ height: 32px;
9
8
  padding: 0 10px;
10
9
  border: 1px solid #949494;
11
10
  font-weight: 600;
@@ -19,6 +18,13 @@ input:focus {
19
18
  .ts-input--padding-1 input {
20
19
  padding: 0 30px 0 10px;
21
20
  }
21
+ /* ####### */
22
+ /* LABEL */
23
+ .ts-input-label {
24
+ padding-bottom: 6px;
25
+ }
26
+ /* ###### */
27
+ /* ICON */
22
28
  .ts-input-icon {
23
29
  position: absolute;
24
30
  top: 0;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { TsInputProps } from './TsInput.types';
3
3
  import './TsInput.css';
4
- export declare const TsInput: ({ icon, value, onChange, ...props }: TsInputProps) => React.JSX.Element;
4
+ export declare const TsInput: ({ icon, label, value, onChange, ...props }: TsInputProps) => React.JSX.Element;
@@ -4,10 +4,11 @@ exports.TsInput = void 0;
4
4
  const React = require("react");
5
5
  const TsIcon_1 = require("../../TsIcon/TsIcon");
6
6
  require("./TsInput.css");
7
- const TsInput = ({ icon, value, onChange, ...props }) => {
7
+ const TsInput = ({ icon, label, value, onChange, ...props }) => {
8
8
  // #########
9
9
  // Rendering
10
10
  return (React.createElement("div", { className: `ts-input ${icon ? 'ts-input--padding-1' : ''}` },
11
+ label && React.createElement("div", { className: "ts-input-label" }, label),
11
12
  React.createElement("input", { type: "text", value: value, onChange: e => onChange(e.target.value), ...props }),
12
13
  icon && (React.createElement("div", { className: "ts-input-icon" },
13
14
  React.createElement(TsIcon_1.TsIcon, { name: icon, size: "16" })))));
@@ -1 +1 @@
1
- {"version":3,"file":"TsInput.js","sourceRoot":"","sources":["../../../../src/components/TsInput/TsInput/TsInput.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,gDAA6C;AAE7C,yBAAuB;AAEhB,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC3E,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,EAAE;QAC7D,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAM,KAAK,GAAI;QACtF,IAAI,IAAI,CACP,6BAAK,SAAS,EAAC,eAAe;YAC5B,oBAAC,eAAM,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,GAAG,CAC5B,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,OAAO,WAalB"}
1
+ {"version":3,"file":"TsInput.js","sourceRoot":"","sources":["../../../../src/components/TsInput/TsInput/TsInput.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,gDAA6C;AAE7C,yBAAuB;AAEhB,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAClF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5D,KAAK,IAAI,6BAAK,SAAS,EAAC,gBAAgB,IAAE,KAAK,CAAO;QACvD,+BAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAM,KAAK,GAAI;QACtF,IAAI,IAAI,CACP,6BAAK,SAAS,EAAC,eAAe;YAC5B,oBAAC,eAAM,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,GAAG,CAC5B,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,OAAO,WAclB"}
@@ -3,11 +3,12 @@ import { TsIcon } from '../../TsIcon/TsIcon';
3
3
  import { TsInputProps } from './TsInput.types';
4
4
  import './TsInput.css';
5
5
 
6
- export const TsInput = ({ icon, value, onChange, ...props }: TsInputProps) => {
6
+ export const TsInput = ({ icon, label, value, onChange, ...props }: TsInputProps) => {
7
7
  // #########
8
8
  // Rendering
9
9
  return (
10
10
  <div className={`ts-input ${icon ? 'ts-input--padding-1' : ''}`}>
11
+ {label && <div className="ts-input-label">{label}</div>}
11
12
  <input type="text" value={value} onChange={e => onChange(e.target.value)} {...props} />
12
13
  {icon && (
13
14
  <div className="ts-input-icon">
@@ -1,5 +1,6 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  export type TsInputProps = {
3
3
  icon?: string;
4
+ label?: string;
4
5
  onChange: (value: string) => void;
5
6
  } & Omit<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>, 'size'>;
@@ -2,5 +2,6 @@ import { InputHTMLAttributes } from 'react';
2
2
 
3
3
  export type TsInputProps = {
4
4
  icon?: string;
5
+ label?: string;
5
6
  onChange: (value: string) => void;
6
7
  } & Omit<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>, 'size'>;
@@ -9,11 +9,15 @@ export const inputArgTypes = {
9
9
  icon: {
10
10
  control: 'select',
11
11
  options: Object.keys(icons),
12
- description: 'Icon of the button.',
12
+ description: 'Icon of the input.',
13
+ },
14
+ label: {
15
+ control: 'text',
16
+ description: 'label of the input.',
13
17
  },
14
18
  placeholder: {
15
19
  control: 'text',
16
- description: 'Placeholder of the button.',
20
+ description: 'Placeholder of the input.',
17
21
  },
18
22
  };
19
23
 
@@ -24,7 +28,11 @@ Input allows the user to enter content and data when the expected user input is
24
28
  ## Overview
25
29
 
26
30
  <Canvas>
27
- <Story name="Overview" args={{ onChange: () => {} }} argTypes={inputArgTypes}>
31
+ <Story
32
+ name="Overview"
33
+ args={{ label: '', placeholder: 'Enter some text', onChange: () => {} }}
34
+ argTypes={inputArgTypes}
35
+ >
28
36
  {args => <TsInput {...args} />}
29
37
  </Story>
30
38
  </Canvas>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dktunited-techoff/techoff-suite-ui",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib",
6
6
  "module": "esm/index.js",
@@ -1,11 +1,10 @@
1
1
  .ts-input {
2
2
  position: relative;
3
3
  width: 100%;
4
- height: 32px;
5
4
  }
6
5
  input {
7
6
  width: 100%;
8
- height: 100%;
7
+ height: 32px;
9
8
  padding: 0 10px;
10
9
  border: 1px solid #949494;
11
10
  font-weight: 600;
@@ -19,6 +18,13 @@ input:focus {
19
18
  .ts-input--padding-1 input {
20
19
  padding: 0 30px 0 10px;
21
20
  }
21
+ /* ####### */
22
+ /* LABEL */
23
+ .ts-input-label {
24
+ padding-bottom: 6px;
25
+ }
26
+ /* ###### */
27
+ /* ICON */
22
28
  .ts-input-icon {
23
29
  position: absolute;
24
30
  top: 0;
@@ -3,11 +3,12 @@ import { TsIcon } from '../../TsIcon/TsIcon';
3
3
  import { TsInputProps } from './TsInput.types';
4
4
  import './TsInput.css';
5
5
 
6
- export const TsInput = ({ icon, value, onChange, ...props }: TsInputProps) => {
6
+ export const TsInput = ({ icon, label, value, onChange, ...props }: TsInputProps) => {
7
7
  // #########
8
8
  // Rendering
9
9
  return (
10
10
  <div className={`ts-input ${icon ? 'ts-input--padding-1' : ''}`}>
11
+ {label && <div className="ts-input-label">{label}</div>}
11
12
  <input type="text" value={value} onChange={e => onChange(e.target.value)} {...props} />
12
13
  {icon && (
13
14
  <div className="ts-input-icon">
@@ -2,5 +2,6 @@ import { InputHTMLAttributes } from 'react';
2
2
 
3
3
  export type TsInputProps = {
4
4
  icon?: string;
5
+ label?: string;
5
6
  onChange: (value: string) => void;
6
7
  } & Omit<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>, 'size'>;
@@ -9,11 +9,15 @@ export const inputArgTypes = {
9
9
  icon: {
10
10
  control: 'select',
11
11
  options: Object.keys(icons),
12
- description: 'Icon of the button.',
12
+ description: 'Icon of the input.',
13
+ },
14
+ label: {
15
+ control: 'text',
16
+ description: 'label of the input.',
13
17
  },
14
18
  placeholder: {
15
19
  control: 'text',
16
- description: 'Placeholder of the button.',
20
+ description: 'Placeholder of the input.',
17
21
  },
18
22
  };
19
23
 
@@ -24,7 +28,11 @@ Input allows the user to enter content and data when the expected user input is
24
28
  ## Overview
25
29
 
26
30
  <Canvas>
27
- <Story name="Overview" args={{ onChange: () => {} }} argTypes={inputArgTypes}>
31
+ <Story
32
+ name="Overview"
33
+ args={{ label: '', placeholder: 'Enter some text', onChange: () => {} }}
34
+ argTypes={inputArgTypes}
35
+ >
28
36
  {args => <TsInput {...args} />}
29
37
  </Story>
30
38
  </Canvas>