@dktunited-techoff/techoff-suite-ui 0.8.15 → 0.9.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.
- package/esm/components/Select/Select.css +30 -0
- package/esm/components/Select/Select.d.ts +4 -0
- package/esm/components/Select/Select.js +16 -0
- package/esm/components/Select/Select.js.map +1 -0
- package/esm/components/Select/Select.types.d.ts +6 -0
- package/esm/components/Select/Select.types.js +2 -0
- package/esm/components/Select/Select.types.js.map +1 -0
- package/esm/components/Select/__stories__/Select.stories.mdx +40 -0
- package/lib/components/Select/Select.css +30 -0
- package/lib/components/Select/Select.d.ts +4 -0
- package/lib/components/Select/Select.js +20 -0
- package/lib/components/Select/Select.js.map +1 -0
- package/lib/components/Select/Select.types.d.ts +6 -0
- package/lib/components/Select/Select.types.js +3 -0
- package/lib/components/Select/Select.types.js.map +1 -0
- package/lib/components/Select/__stories__/Select.stories.mdx +40 -0
- package/package.json +1 -1
- package/src/components/Select/Select.css +30 -0
- package/src/components/Select/Select.tsx +24 -0
- package/src/components/Select/Select.types.ts +3 -0
- package/src/components/Select/__stories__/Select.stories.mdx +40 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.select-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
.select-container > label {
|
|
6
|
+
display: block;
|
|
7
|
+
margin-bottom: 4px;
|
|
8
|
+
color: #012b49;
|
|
9
|
+
font-weight: 700;
|
|
10
|
+
}
|
|
11
|
+
.select-container > select {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 32px;
|
|
14
|
+
padding: 0 40px 0 12px;
|
|
15
|
+
border: 1px solid #d4d4d4;
|
|
16
|
+
border-radius: 6px;
|
|
17
|
+
color: #007dbc;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* ######### */
|
|
23
|
+
/* GLOBALS */
|
|
24
|
+
* {
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
outline: none;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
29
|
+
'Helvetica Neue', sans-serif;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './Select.css';
|
|
3
|
+
export const Select = ({ label, options, onChange }) => {
|
|
4
|
+
// ########
|
|
5
|
+
// Handlers
|
|
6
|
+
const handleChange = (e) => onChange(e.target.value);
|
|
7
|
+
// #########
|
|
8
|
+
// Rendering
|
|
9
|
+
return (React.createElement("div", { className: "select-container" },
|
|
10
|
+
label && React.createElement("label", null, label),
|
|
11
|
+
React.createElement("select", { onChange: handleChange },
|
|
12
|
+
React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement("option", null, "-"),
|
|
14
|
+
options))));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,EAAE,EAAE;IAClE,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,CAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC9B,KAAK,IAAI,mCAAQ,KAAK,CAAS;QAChC,gCAAQ,QAAQ,EAAE,YAAY;YAC5B;gBACE,wCAAkB;gBACjB,OAAO,CACP,CACI,CACL,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.types.js","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { Select } from '../Select';
|
|
4
|
+
|
|
5
|
+
<Meta title="Components/Select" />
|
|
6
|
+
|
|
7
|
+
export const selectArgTypes = {
|
|
8
|
+
label: {
|
|
9
|
+
control: 'text',
|
|
10
|
+
description: 'Label of the input.',
|
|
11
|
+
},
|
|
12
|
+
onChange: {
|
|
13
|
+
control: 'function',
|
|
14
|
+
description: 'The handler called when the value of the select changes.',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
# Loader
|
|
19
|
+
|
|
20
|
+
Loader express to user that an action is occuring.
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
<Canvas>
|
|
25
|
+
<Story
|
|
26
|
+
name="Overview"
|
|
27
|
+
args={{
|
|
28
|
+
label: 'Label',
|
|
29
|
+
options: [<option value="orange">Orange</option>, <option value="apple">Apple</option>],
|
|
30
|
+
onChange: () => {},
|
|
31
|
+
}}
|
|
32
|
+
argTypes={selectArgTypes}
|
|
33
|
+
>
|
|
34
|
+
{args => <Select {...args} />}
|
|
35
|
+
</Story>
|
|
36
|
+
</Canvas>
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
<ArgsTable story="Overview" of={Select} />
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.select-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
.select-container > label {
|
|
6
|
+
display: block;
|
|
7
|
+
margin-bottom: 4px;
|
|
8
|
+
color: #012b49;
|
|
9
|
+
font-weight: 700;
|
|
10
|
+
}
|
|
11
|
+
.select-container > select {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 32px;
|
|
14
|
+
padding: 0 40px 0 12px;
|
|
15
|
+
border: 1px solid #d4d4d4;
|
|
16
|
+
border-radius: 6px;
|
|
17
|
+
color: #007dbc;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* ######### */
|
|
23
|
+
/* GLOBALS */
|
|
24
|
+
* {
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
outline: none;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
29
|
+
'Helvetica Neue', sans-serif;
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Select = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
require("./Select.css");
|
|
6
|
+
const Select = ({ label, options, onChange }) => {
|
|
7
|
+
// ########
|
|
8
|
+
// Handlers
|
|
9
|
+
const handleChange = (e) => onChange(e.target.value);
|
|
10
|
+
// #########
|
|
11
|
+
// Rendering
|
|
12
|
+
return (React.createElement("div", { className: "select-container" },
|
|
13
|
+
label && React.createElement("label", null, label),
|
|
14
|
+
React.createElement("select", { onChange: handleChange },
|
|
15
|
+
React.createElement(React.Fragment, null,
|
|
16
|
+
React.createElement("option", null, "-"),
|
|
17
|
+
options))));
|
|
18
|
+
};
|
|
19
|
+
exports.Select = Select;
|
|
20
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAG/B,wBAAsB;AAEf,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,EAAE,EAAE;IAClE,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,CAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC9B,KAAK,IAAI,mCAAQ,KAAK,CAAS;QAChC,gCAAQ,QAAQ,EAAE,YAAY;YAC5B;gBACE,wCAAkB;gBACjB,OAAO,CACP,CACI,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,MAAM,UAkBjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.types.js","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { Select } from '../Select';
|
|
4
|
+
|
|
5
|
+
<Meta title="Components/Select" />
|
|
6
|
+
|
|
7
|
+
export const selectArgTypes = {
|
|
8
|
+
label: {
|
|
9
|
+
control: 'text',
|
|
10
|
+
description: 'Label of the input.',
|
|
11
|
+
},
|
|
12
|
+
onChange: {
|
|
13
|
+
control: 'function',
|
|
14
|
+
description: 'The handler called when the value of the select changes.',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
# Loader
|
|
19
|
+
|
|
20
|
+
Loader express to user that an action is occuring.
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
<Canvas>
|
|
25
|
+
<Story
|
|
26
|
+
name="Overview"
|
|
27
|
+
args={{
|
|
28
|
+
label: 'Label',
|
|
29
|
+
options: [<option value="orange">Orange</option>, <option value="apple">Apple</option>],
|
|
30
|
+
onChange: () => {},
|
|
31
|
+
}}
|
|
32
|
+
argTypes={selectArgTypes}
|
|
33
|
+
>
|
|
34
|
+
{args => <Select {...args} />}
|
|
35
|
+
</Story>
|
|
36
|
+
</Canvas>
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
<ArgsTable story="Overview" of={Select} />
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.select-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
.select-container > label {
|
|
6
|
+
display: block;
|
|
7
|
+
margin-bottom: 4px;
|
|
8
|
+
color: #012b49;
|
|
9
|
+
font-weight: 700;
|
|
10
|
+
}
|
|
11
|
+
.select-container > select {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 32px;
|
|
14
|
+
padding: 0 40px 0 12px;
|
|
15
|
+
border: 1px solid #d4d4d4;
|
|
16
|
+
border-radius: 6px;
|
|
17
|
+
color: #007dbc;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* ######### */
|
|
23
|
+
/* GLOBALS */
|
|
24
|
+
* {
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
outline: none;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
29
|
+
'Helvetica Neue', sans-serif;
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChangeEvent } from 'react';
|
|
3
|
+
import { SelectProps } from './Select.types';
|
|
4
|
+
import './Select.css';
|
|
5
|
+
|
|
6
|
+
export const Select = ({ label, options, onChange }: SelectProps) => {
|
|
7
|
+
// ########
|
|
8
|
+
// Handlers
|
|
9
|
+
const handleChange = (e: ChangeEvent<HTMLSelectElement>) => onChange(e.target.value);
|
|
10
|
+
|
|
11
|
+
// #########
|
|
12
|
+
// Rendering
|
|
13
|
+
return (
|
|
14
|
+
<div className="select-container">
|
|
15
|
+
{label && <label>{label}</label>}
|
|
16
|
+
<select onChange={handleChange}>
|
|
17
|
+
<>
|
|
18
|
+
<option>-</option>
|
|
19
|
+
{options}
|
|
20
|
+
</>
|
|
21
|
+
</select>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { Select } from '../Select';
|
|
4
|
+
|
|
5
|
+
<Meta title="Components/Select" />
|
|
6
|
+
|
|
7
|
+
export const selectArgTypes = {
|
|
8
|
+
label: {
|
|
9
|
+
control: 'text',
|
|
10
|
+
description: 'Label of the input.',
|
|
11
|
+
},
|
|
12
|
+
onChange: {
|
|
13
|
+
control: 'function',
|
|
14
|
+
description: 'The handler called when the value of the select changes.',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
# Loader
|
|
19
|
+
|
|
20
|
+
Loader express to user that an action is occuring.
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
<Canvas>
|
|
25
|
+
<Story
|
|
26
|
+
name="Overview"
|
|
27
|
+
args={{
|
|
28
|
+
label: 'Label',
|
|
29
|
+
options: [<option value="orange">Orange</option>, <option value="apple">Apple</option>],
|
|
30
|
+
onChange: () => {},
|
|
31
|
+
}}
|
|
32
|
+
argTypes={selectArgTypes}
|
|
33
|
+
>
|
|
34
|
+
{args => <Select {...args} />}
|
|
35
|
+
</Story>
|
|
36
|
+
</Canvas>
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
<ArgsTable story="Overview" of={Select} />
|