@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.
@@ -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,4 @@
1
+ import * as React from 'react';
2
+ import { SelectProps } from './Select.types';
3
+ import './Select.css';
4
+ export declare const Select: ({ label, options, onChange }: SelectProps) => React.JSX.Element;
@@ -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,6 @@
1
+ import { ReactNode } from 'react';
2
+ export type SelectProps = {
3
+ label?: string;
4
+ options: ReactNode[];
5
+ onChange: (val: string) => void;
6
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Select.types.js.map
@@ -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,4 @@
1
+ import * as React from 'react';
2
+ import { SelectProps } from './Select.types';
3
+ import './Select.css';
4
+ export declare const Select: ({ label, options, onChange }: SelectProps) => React.JSX.Element;
@@ -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,6 @@
1
+ import { ReactNode } from 'react';
2
+ export type SelectProps = {
3
+ label?: string;
4
+ options: ReactNode[];
5
+ onChange: (val: string) => void;
6
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Select.types.js.map
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dktunited-techoff/techoff-suite-ui",
3
- "version": "0.8.15",
3
+ "version": "0.9.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib",
6
6
  "module": "esm/index.js",
@@ -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,3 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export type SelectProps = { label?: string; options: ReactNode[]; onChange: (val: string) => void };
@@ -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} />