@dktunited-techoff/techoff-suite-ui 1.5.6 → 1.6.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/TsCheckbox/TsCheckbox.css +1 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.css +83 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.d.ts +4 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.js +44 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.js.map +1 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.tsx +88 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.types.d.ts +12 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.types.js +2 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.types.js.map +1 -0
- package/esm/components/TsDropdown/TsDropdown/TsDropdown.types.ts +12 -0
- package/esm/components/TsDropdown/TsDropdown/__stories__/TsDropdown.stories.mdx +68 -0
- package/esm/components/TsDropdown/TsDropdown/__stories__/fruits.d.ts +4 -0
- package/esm/components/TsDropdown/TsDropdown/__stories__/fruits.js +48 -0
- package/esm/components/TsDropdown/TsDropdown/__stories__/fruits.js.map +1 -0
- package/esm/components/TsDropdown/TsDropdown/__stories__/fruits.ts +47 -0
- package/esm/components/TsInput/TsInput/TsInput.css +5 -2
- package/esm/components/TsInput/TsInput/TsInput.js +1 -1
- package/esm/components/TsInput/TsInput/TsInput.js.map +1 -1
- package/esm/components/TsInput/TsInput/TsInput.tsx +1 -1
- package/esm/components/TsInput/TsInput/__stories__/TsInput.stories.mdx +6 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/lib/components/TsCheckbox/TsCheckbox.css +1 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.css +83 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.d.ts +4 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.js +48 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.js.map +1 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.tsx +88 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.types.d.ts +12 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.types.js +3 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.types.js.map +1 -0
- package/lib/components/TsDropdown/TsDropdown/TsDropdown.types.ts +12 -0
- package/lib/components/TsDropdown/TsDropdown/__stories__/TsDropdown.stories.mdx +68 -0
- package/lib/components/TsDropdown/TsDropdown/__stories__/fruits.d.ts +4 -0
- package/lib/components/TsDropdown/TsDropdown/__stories__/fruits.js +51 -0
- package/lib/components/TsDropdown/TsDropdown/__stories__/fruits.js.map +1 -0
- package/lib/components/TsDropdown/TsDropdown/__stories__/fruits.ts +47 -0
- package/lib/components/TsInput/TsInput/TsInput.css +5 -2
- package/lib/components/TsInput/TsInput/TsInput.js +1 -1
- package/lib/components/TsInput/TsInput/TsInput.js.map +1 -1
- package/lib/components/TsInput/TsInput/TsInput.tsx +1 -1
- package/lib/components/TsInput/TsInput/__stories__/TsInput.stories.mdx +6 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TsCheckbox/TsCheckbox.css +1 -0
- package/src/components/TsDropdown/TsDropdown/TsDropdown.css +83 -0
- package/src/components/TsDropdown/TsDropdown/TsDropdown.tsx +88 -0
- package/src/components/TsDropdown/TsDropdown/TsDropdown.types.ts +12 -0
- package/src/components/TsDropdown/TsDropdown/__stories__/TsDropdown.stories.mdx +68 -0
- package/src/components/TsDropdown/TsDropdown/__stories__/fruits.ts +47 -0
- package/src/components/TsInput/TsInput/TsInput.css +5 -2
- package/src/components/TsInput/TsInput/TsInput.tsx +1 -1
- package/src/components/TsInput/TsInput/__stories__/TsInput.stories.mdx +6 -1
- package/src/index.ts +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { TsDropdown } from '../TsDropdown';
|
|
4
|
+
import { fruits } from './fruits';
|
|
5
|
+
|
|
6
|
+
<Meta title="Components/Dropdown" />
|
|
7
|
+
|
|
8
|
+
export const dropdownArgTypes = {
|
|
9
|
+
label: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'Label of the dropdown.',
|
|
12
|
+
},
|
|
13
|
+
placeholder: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Placeholder of the dropdown.',
|
|
16
|
+
},
|
|
17
|
+
searchPlaceholder: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Placeholder of the option search (only for searchable dropdowns).',
|
|
20
|
+
},
|
|
21
|
+
searchable: {
|
|
22
|
+
control: 'boolean',
|
|
23
|
+
description: 'Enable search on dropdown items.',
|
|
24
|
+
table: { defaultValue: { summary: 'false' } },
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Enable state of the dropdown.',
|
|
29
|
+
table: { defaultValue: { summary: 'false' } },
|
|
30
|
+
},
|
|
31
|
+
onChange: {
|
|
32
|
+
control: 'function',
|
|
33
|
+
description: 'The handler called when clicking on the dropdown.',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
# Dropdown
|
|
38
|
+
|
|
39
|
+
Dropdowns show a list of options that can be used to select, filter or sort content.
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
<Canvas>
|
|
44
|
+
<Story
|
|
45
|
+
name="Overview"
|
|
46
|
+
args={{
|
|
47
|
+
label: 'Label',
|
|
48
|
+
options: fruits,
|
|
49
|
+
searchPlaceholder: '',
|
|
50
|
+
placeholder: 'Select an item',
|
|
51
|
+
disabled: false,
|
|
52
|
+
searchable: false,
|
|
53
|
+
getOptionLabel: function ol(fruit) {
|
|
54
|
+
return fruit.name;
|
|
55
|
+
},
|
|
56
|
+
getOptionValue: function ov(fruit) {
|
|
57
|
+
return fruit.id;
|
|
58
|
+
},
|
|
59
|
+
}}
|
|
60
|
+
argTypes={dropdownArgTypes}
|
|
61
|
+
>
|
|
62
|
+
{args => <TsDropdown {...args}>{args.children}</TsDropdown>}
|
|
63
|
+
</Story>
|
|
64
|
+
</Canvas>
|
|
65
|
+
|
|
66
|
+
## Props
|
|
67
|
+
|
|
68
|
+
<ArgsTable story="Overview" of={TsDropdown} />
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const fruits = [
|
|
2
|
+
{ name: 'Persimmon', id: 52 },
|
|
3
|
+
{ name: 'Strawberry', id: 3 },
|
|
4
|
+
{ name: 'Banana', id: 1 },
|
|
5
|
+
{ name: 'Tomato', id: 5 },
|
|
6
|
+
{ name: 'Pear', id: 4 },
|
|
7
|
+
{ name: 'Durian', id: 60 },
|
|
8
|
+
{ name: 'Blackberry', id: 64 },
|
|
9
|
+
{ name: 'Lingonberry', id: 65 },
|
|
10
|
+
{ name: 'Kiwi', id: 66 },
|
|
11
|
+
{ name: 'Lychee', id: 67 },
|
|
12
|
+
{ name: 'Pineapple', id: 10 },
|
|
13
|
+
{ name: 'Fig', id: 68 },
|
|
14
|
+
{ name: 'Gooseberry', id: 69 },
|
|
15
|
+
{ name: 'Passionfruit', id: 70 },
|
|
16
|
+
{ name: 'Plum', id: 71 },
|
|
17
|
+
{ name: 'Orange', id: 2 },
|
|
18
|
+
{ name: 'GreenApple', id: 72 },
|
|
19
|
+
{ name: 'Raspberry', id: 23 },
|
|
20
|
+
{ name: 'Watermelon', id: 25 },
|
|
21
|
+
{ name: 'Lemon', id: 26 },
|
|
22
|
+
{ name: 'Mango', id: 27 },
|
|
23
|
+
{ name: 'Blueberry', id: 33 },
|
|
24
|
+
{ name: 'Apple', id: 6 },
|
|
25
|
+
{ name: 'Guava', id: 37 },
|
|
26
|
+
{ name: 'Apricot', id: 35 },
|
|
27
|
+
{ name: 'Papaya', id: 42 },
|
|
28
|
+
{ name: 'Melon', id: 41 },
|
|
29
|
+
{ name: 'Tangerine', id: 77 },
|
|
30
|
+
{ name: 'Pitahaya', id: 78 },
|
|
31
|
+
{ name: 'Lime', id: 44 },
|
|
32
|
+
{ name: 'Pomegranate', id: 79 },
|
|
33
|
+
{ name: 'Dragonfruit', id: 80 },
|
|
34
|
+
{ name: 'Grape', id: 81 },
|
|
35
|
+
{ name: 'Morus', id: 82 },
|
|
36
|
+
{ name: 'Feijoa', id: 76 },
|
|
37
|
+
{ name: 'Avocado', id: 84 },
|
|
38
|
+
{ name: 'Kiwifruit', id: 85 },
|
|
39
|
+
{ name: 'Cranberry', id: 87 },
|
|
40
|
+
{ name: 'Cherry', id: 9 },
|
|
41
|
+
{ name: 'Peach', id: 86 },
|
|
42
|
+
{ name: 'Jackfruit', id: 94 },
|
|
43
|
+
{ name: 'Horned Melon', id: 95 },
|
|
44
|
+
{ name: 'Hazelnut', id: 96 },
|
|
45
|
+
{ name: 'Pomelo', id: 98 },
|
|
46
|
+
{ name: 'Mangosteen', id: 99 },
|
|
47
|
+
];
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
width: 100%;
|
|
7
7
|
}
|
|
8
|
-
input {
|
|
8
|
+
.ts-input-container input {
|
|
9
9
|
width: 100%;
|
|
10
10
|
height: 32px;
|
|
11
|
-
padding: 0 10px;
|
|
12
11
|
border: 1px solid #949494;
|
|
13
12
|
font-weight: 600;
|
|
14
13
|
}
|
|
15
14
|
input::placeholder {
|
|
15
|
+
color: #7a7a7a;
|
|
16
16
|
font-weight: 400;
|
|
17
17
|
}
|
|
18
18
|
input:disabled {
|
|
@@ -21,6 +21,9 @@ input:disabled {
|
|
|
21
21
|
input:focus {
|
|
22
22
|
border: 1.5px solid #3643ba;
|
|
23
23
|
}
|
|
24
|
+
.ts-input--padding-0 input {
|
|
25
|
+
padding: 0 10px;
|
|
26
|
+
}
|
|
24
27
|
.ts-input--padding-1 input {
|
|
25
28
|
padding: 0 30px 0 10px;
|
|
26
29
|
}
|
|
@@ -7,7 +7,7 @@ export const TsInput = ({ icon, label, value, onChange, ...props }: TsInputProps
|
|
|
7
7
|
// #########
|
|
8
8
|
// Rendering
|
|
9
9
|
return (
|
|
10
|
-
<div className={`ts-input ${icon ? 'ts-input--padding-1' : ''}`}>
|
|
10
|
+
<div className={`ts-input ${icon ? 'ts-input--padding-1' : 'ts-input--padding-0'}`}>
|
|
11
11
|
{label && <div className="ts-input-label">{label}</div>}
|
|
12
12
|
<div className="ts-input-container">
|
|
13
13
|
<input type="text" value={value} onChange={e => onChange(e.target.value)} {...props} />
|
|
@@ -19,6 +19,11 @@ export const inputArgTypes = {
|
|
|
19
19
|
control: 'text',
|
|
20
20
|
description: 'Placeholder of the input.',
|
|
21
21
|
},
|
|
22
|
+
disabled: {
|
|
23
|
+
control: 'boolean',
|
|
24
|
+
description: 'Enable state of the input.',
|
|
25
|
+
table: { defaultValue: { summary: 'false' } },
|
|
26
|
+
},
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
# Input
|
|
@@ -30,7 +35,7 @@ Input allows the user to enter content and data when the expected user input is
|
|
|
30
35
|
<Canvas>
|
|
31
36
|
<Story
|
|
32
37
|
name="Overview"
|
|
33
|
-
args={{ label: '', placeholder: 'Enter some text', onChange: () => {} }}
|
|
38
|
+
args={{ label: 'Label', placeholder: 'Enter some text', disabled: false, onChange: () => {} }}
|
|
34
39
|
argTypes={inputArgTypes}
|
|
35
40
|
>
|
|
36
41
|
{args => <TsInput {...args} />}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './components/TsButton/TsButton';
|
|
2
2
|
export * from './components/TsCheckbox/TsCheckbox';
|
|
3
|
+
export * from './components/TsDropdown/TsDropdown/TsDropdown';
|
|
3
4
|
export * from './components/TsIcon/TsIcon';
|
|
4
5
|
export * from './components/TsInput/TsInput/TsInput';
|
|
5
6
|
export * from './components/TsLoader/TsLoader';
|