@yakad/ui 1.2.78-beta → 1.2.80-beta

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.
@@ -4,5 +4,5 @@ interface CodeFieldsProps extends React.HTMLAttributes<HTMLInputElement> {
4
4
  name?: string;
5
5
  type?: string;
6
6
  }
7
- declare function CodeField(props: CodeFieldsProps): JSX.Element;
7
+ declare function CodeField(this: any, props: CodeFieldsProps): JSX.Element;
8
8
  export default CodeField;
@@ -1,10 +1,18 @@
1
1
  import React from "react";
2
2
  import { joinClassNames, joinStyles } from "@yakad/lib";
3
3
  import styles from "./codeField.module.css";
4
+ function sliceOverLength(event, length) {
5
+ const targetInput = event.target;
6
+ const targetLength = targetInput.value.length;
7
+ if (targetLength > length)
8
+ targetInput.value = targetInput.value.slice(0, targetLength - 1);
9
+ targetInput.value = targetInput.value.replace(/[^0-9]+/, "");
10
+ }
4
11
  function CodeField(props) {
12
+ const length = props.length ? props.length : 6;
5
13
  const joinedClassNames = joinClassNames(styles.input, props.className);
6
14
  const joinedStyles = joinStyles({ width: "calc(1.5ch * " + props.length + ")" }, props.style);
7
- return (React.createElement("input", { ...props, name: props.name, type: props.type, minLength: props.length, maxLength: props.length, className: joinedClassNames, style: joinedStyles }));
15
+ return (React.createElement("input", { name: props.name, type: "number", minLength: length, maxLength: length, className: joinedClassNames, style: joinedStyles, onInput: (event) => sliceOverLength(event, length), autoComplete: "off", pattern: "[0-9]" }));
8
16
  }
9
17
  export default CodeField;
10
18
  //# sourceMappingURL=codeField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeField.js","sourceRoot":"","sources":["codeField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAQ5C,SAAS,SAAS,CAAC,KAAsB;IACrC,MAAM,gBAAgB,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AEvD,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAExE,MAAM,YAAY,GAAG,UAAU,CAC3B,EAAE,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,EAC/C,KAAK,CAAC,KAAM,CACf,CAAC;IAEF,OAAO,CACH,+BACI,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAClD,YAAY,EAAC,KAAK,EAClB,OAAO,EAAC,OAAO,GACjB,CACL,CAAC;AACN,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -21,3 +21,8 @@
21
21
  .input:focus {
22
22
  outline: none;
23
23
  }
24
+ input::-webkit-outer-spin-button,
25
+ input::-webkit-inner-spin-button {
26
+ -webkit-appearance: none;
27
+ margin: 0;
28
+ }
@@ -8,7 +8,21 @@ interface CodeFieldsProps extends React.HTMLAttributes<HTMLInputElement> {
8
8
  type?: string;
9
9
  }
10
10
 
11
- function CodeField(props: CodeFieldsProps) {
11
+ function sliceOverLength(
12
+ event: React.FormEvent<HTMLInputElement>,
13
+ length: number
14
+ ) {
15
+ const targetInput = event.target as HTMLInputElement;
16
+ const targetLength = targetInput.value.length;
17
+ if (targetLength > length)
18
+ targetInput.value = targetInput.value.slice(0, targetLength - 1);
19
+
20
+ targetInput.value = targetInput.value.replace(/[^0-9]+/, "");
21
+ }
22
+
23
+ function CodeField(this: any, props: CodeFieldsProps) {
24
+ const length: number = props.length ? props.length : 6;
25
+
12
26
  const joinedClassNames = joinClassNames(styles.input, props.className!);
13
27
 
14
28
  const joinedStyles = joinStyles(
@@ -18,13 +32,15 @@ function CodeField(props: CodeFieldsProps) {
18
32
 
19
33
  return (
20
34
  <input
21
- {...props}
22
35
  name={props.name}
23
- type={props.type}
24
- minLength={props.length}
25
- maxLength={props.length}
36
+ type="number"
37
+ minLength={length}
38
+ maxLength={length}
26
39
  className={joinedClassNames}
27
40
  style={joinedStyles}
41
+ onInput={(event) => sliceOverLength(event, length)}
42
+ autoComplete="off"
43
+ pattern="[0-9]"
28
44
  />
29
45
  );
30
46
  }
package/index.d.ts CHANGED
@@ -21,4 +21,5 @@ import CodeField from "./codeField/codeField";
21
21
  import InputField from "./inputField/inputField";
22
22
  import Theme from "./theme/theme";
23
23
  import ClickAwayListener from "./clickAwayListener/clickAwayListener";
24
- export { Button, AppBar, Card, Container, Footer, Form, GridContainer, GridItem, Hr, List, ListItem, Main, Navigation, Page, Row, Stack, Spacer, SvgIcon, Loading, CodeField, InputField, Theme, ClickAwayListener, };
24
+ import { Table, Thead, Tbody, Tfoot, Tr, Th, Td } from "./table/table";
25
+ export { Button, AppBar, Card, Container, Footer, Form, GridContainer, GridItem, Hr, List, ListItem, Main, Navigation, Page, Row, Stack, Spacer, SvgIcon, Loading, CodeField, InputField, Theme, ClickAwayListener, Table, Thead, Tbody, Tfoot, Tr, Th, Td, };
package/index.js CHANGED
@@ -21,5 +21,6 @@ import CodeField from "./codeField/codeField";
21
21
  import InputField from "./inputField/inputField";
22
22
  import Theme from "./theme/theme";
23
23
  import ClickAwayListener from "./clickAwayListener/clickAwayListener";
24
- export { Button, AppBar, Card, Container, Footer, Form, GridContainer, GridItem, Hr, List, ListItem, Main, Navigation, Page, Row, Stack, Spacer, SvgIcon, Loading, CodeField, InputField, Theme, ClickAwayListener, };
24
+ import { Table, Thead, Tbody, Tfoot, Tr, Th, Td } from "./table/table";
25
+ export { Button, AppBar, Card, Container, Footer, Form, GridContainer, GridItem, Hr, List, ListItem, Main, Navigation, Page, Row, Stack, Spacer, SvgIcon, Loading, CodeField, InputField, Theme, ClickAwayListener, Table, Thead, Tbody, Tfoot, Tr, Th, Td, };
25
26
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AACtE,OAAO,EACH,MAAM,EACN,MAAM,EACN,IAAI,EACJ,SAAS,EACT,MAAM,EACN,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EAC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ACb,QAAQ,EACR,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,UAAU,EACV,KAAK,EACL,iBAAiB,EACjB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,EAAE,EACF,EAAE,EACF,EAAE,GACL,CAAC"}
package/index.tsx CHANGED
@@ -21,6 +21,7 @@ import CodeField from "./codeField/codeField";
21
21
  import InputField from "./inputField/inputField";
22
22
  import Theme from "./theme/theme";
23
23
  import ClickAwayListener from "./clickAwayListener/clickAwayListener";
24
+ import { Table, Thead, Tbody, Tfoot, Tr, Th, Td } from "./table/table";
24
25
  export {
25
26
  Button,
26
27
  AppBar,
@@ -45,4 +46,11 @@ export {
45
46
  InputField,
46
47
  Theme,
47
48
  ClickAwayListener,
49
+ Table,
50
+ Thead,
51
+ Tbody,
52
+ Tfoot,
53
+ Tr,
54
+ Th,
55
+ Td,
48
56
  };
@@ -4,7 +4,7 @@ import styles from "./inputField.module.css";
4
4
  function InputField(props) {
5
5
  const joinedClassNames = joinClassNames(styles.input, props.variant ? styles[props.variant] : styles.standard, props.className);
6
6
  return (React.createElement("label", { className: styles.label },
7
- React.createElement("input", { ...props, name: props.name, disabled: props.disabled, placeholder: " ", type: props.type, value: props.value, className: joinedClassNames }),
7
+ React.createElement("input", { ...props, name: props.name, disabled: props.disabled, placeholder: " ", type: props.type, value: props.value, className: joinedClassNames, autoFocus: true }),
8
8
  React.createElement("span", { className: styles.span }, props.placeholder)));
9
9
  }
10
10
  export default InputField;
@@ -1 +1 @@
1
- {"version":3,"file":"inputField.js","sourceRoot":"","sources":["inputField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAY7C,SAA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AI,EAChB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,SACX;QACF,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,IAAG,KAAK,CAAC,WAAW,CAAQ,CACpD,CACX,CAAC;AACN,CAAC;AAED,eAAe,UAAU,CAAC"}
@@ -29,6 +29,7 @@ function InputField(props: InputFieldProps) {
29
29
  type={props.type}
30
30
  value={props.value}
31
31
  className={joinedClassNames}
32
+ autoFocus
32
33
  />
33
34
  <span className={styles.span}>{props.placeholder}</span>
34
35
  </label>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yakad/ui",
3
- "version": "1.2.78-beta",
3
+ "version": "1.2.80-beta",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -12,11 +12,11 @@
12
12
  "url": "git+https://github.com/NatiqQuran/yakad.git"
13
13
  },
14
14
  "author": "Natiq",
15
- "license": "GPL-3.0",
15
+ "license": "MIT",
16
16
  "bugs": {
17
17
  "url": "https://github.com/NatiqQuran/yakad/issues"
18
18
  },
19
- "homepage": "https://github.com/NatiqQuran/yakad#readme",
19
+ "homepage": "https://yakad.natiq.net",
20
20
  "dependencies": {
21
21
  "@types/react": "18.0.24",
22
22
  "@types/react-dom": "18.0.6",
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export declare function Table(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
3
+ export declare function Thead(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
4
+ export declare function Tbody(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
5
+ export declare function Tfoot(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
6
+ export declare function Tr(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
7
+ export declare function Th(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
8
+ export declare function Td(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
package/table/table.js ADDED
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { joinClassNames } from "@yakad/lib";
3
+ import styles from "./table.module.css";
4
+ export function Table(props) {
5
+ const joinedClassNames = joinClassNames(styles.table, props.className);
6
+ return (React.createElement("table", { ...props, className: joinedClassNames }, props.children));
7
+ }
8
+ export function Thead(props) {
9
+ const joinedClassNames = joinClassNames(styles.thead, props.className);
10
+ return (React.createElement("thead", { ...props, className: joinedClassNames }, props.children));
11
+ }
12
+ export function Tbody(props) {
13
+ const joinedClassNames = joinClassNames(styles.tbody, props.className);
14
+ return (React.createElement("tbody", { ...props, className: joinedClassNames }, props.children));
15
+ }
16
+ export function Tfoot(props) {
17
+ const joinedClassNames = joinClassNames(styles.tfoot, props.className);
18
+ return (React.createElement("tfoot", { ...props, className: joinedClassNames }, props.children));
19
+ }
20
+ export function Tr(props) {
21
+ const joinedClassNames = joinClassNames(styles.tr, props.className);
22
+ return (React.createElement("tr", { ...props, className: joinedClassNames }, props.children));
23
+ }
24
+ export function Th(props) {
25
+ const joinedClassNames = joinClassNames(styles.th, props.className);
26
+ return (React.createElement("th", { ...props, className: joinedClassNames }, props.children));
27
+ }
28
+ export function Td(props) {
29
+ const joinedClassNames = joinClassNames(styles.td, props.className);
30
+ return (React.createElement("td", { ...props, className: joinedClassNames }, props.children));
31
+ }
32
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,UAAU,KAAK,CAAC,KAAwC;IAC1D,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAExE,OAAO,CACH,kCAAW,KAAK,EAAE,SAA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,CACd,CACR,CAAC;AACN,CAAC;AAED,MAAM,UAAU,EAAE,CAAC,KAAwC;IACvD,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAErE,OAAO,CACH,+BAAQ,KAAK,EAAE,SAAS,EAAE,gBAAgB,IACrC,KAAK,CAAC,QAAQ,CACd,CACR,CAAC;AACN,CAAC"}
@@ -0,0 +1,37 @@
1
+ .table {
2
+ border-collapse: unset;
3
+ border-spacing: unset;
4
+ border-radius: 0.7rem;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .thead {
9
+ border: 0.1rem solid red;
10
+ }
11
+
12
+ .tbody .tr:nth-child(even) {
13
+ background-color: #7d7d7d20;
14
+ }
15
+ .tbody .tr:hover {
16
+ background-color: #7d7d7d30;
17
+ }
18
+
19
+ .thead .th {
20
+ border-bottom: 0.2rem solid #7d7d7d40;
21
+ background-color: rgb(var(--surfaceContainerColor, 243 237 247));
22
+ }
23
+ .tfoot .th {
24
+ border-top: 0.2rem solid #7d7d7d40;
25
+ background-color: rgb(var(--surfaceContainerColor, 243 237 247));
26
+ }
27
+
28
+ .td {
29
+ /* border: 0.1rem solid #7d7d7d40; */
30
+ }
31
+
32
+ .th,
33
+ .td {
34
+ padding: 0 1rem;
35
+ min-height: 3.2rem;
36
+ line-height: 3.2rem;
37
+ }
@@ -0,0 +1,73 @@
1
+ import React from "react";
2
+ import { joinClassNames } from "@yakad/lib";
3
+ import styles from "./table.module.css";
4
+
5
+ export function Table(props: React.HTMLAttributes<HTMLElement>) {
6
+ const joinedClassNames = joinClassNames(styles.table, props.className!);
7
+
8
+ return (
9
+ <table {...props} className={joinedClassNames}>
10
+ {props.children}
11
+ </table>
12
+ );
13
+ }
14
+
15
+ export function Thead(props: React.HTMLAttributes<HTMLElement>) {
16
+ const joinedClassNames = joinClassNames(styles.thead, props.className!);
17
+
18
+ return (
19
+ <thead {...props} className={joinedClassNames}>
20
+ {props.children}
21
+ </thead>
22
+ );
23
+ }
24
+
25
+ export function Tbody(props: React.HTMLAttributes<HTMLElement>) {
26
+ const joinedClassNames = joinClassNames(styles.tbody, props.className!);
27
+
28
+ return (
29
+ <tbody {...props} className={joinedClassNames}>
30
+ {props.children}
31
+ </tbody>
32
+ );
33
+ }
34
+
35
+ export function Tfoot(props: React.HTMLAttributes<HTMLElement>) {
36
+ const joinedClassNames = joinClassNames(styles.tfoot, props.className!);
37
+
38
+ return (
39
+ <tfoot {...props} className={joinedClassNames}>
40
+ {props.children}
41
+ </tfoot>
42
+ );
43
+ }
44
+
45
+ export function Tr(props: React.HTMLAttributes<HTMLElement>) {
46
+ const joinedClassNames = joinClassNames(styles.tr, props.className!);
47
+
48
+ return (
49
+ <tr {...props} className={joinedClassNames}>
50
+ {props.children}
51
+ </tr>
52
+ );
53
+ }
54
+
55
+ export function Th(props: React.HTMLAttributes<HTMLElement>) {
56
+ const joinedClassNames = joinClassNames(styles.th, props.className!);
57
+
58
+ return (
59
+ <th {...props} className={joinedClassNames}>
60
+ {props.children}
61
+ </th>
62
+ );
63
+ }
64
+
65
+ export function Td(props: React.HTMLAttributes<HTMLElement>) {
66
+ const joinedClassNames = joinClassNames(styles.td, props.className!);
67
+
68
+ return (
69
+ <td {...props} className={joinedClassNames}>
70
+ {props.children}
71
+ </td>
72
+ );
73
+ }