@yakad/ui 1.2.97-beta → 1.2.99-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.
- package/button/button.d.ts +2 -1
- package/button/button.js +3 -3
- package/button/button.js.map +1 -1
- package/button/button.module.css +0 -4
- package/button/button.tsx +6 -5
- package/package.json +2 -1
- package/svgIcon/svgIcon.module.css +3 -1
- package/types.tsx +1 -0
package/button/button.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { iconsCode } from "@yakad/symbols/types";
|
|
2
3
|
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
4
|
size?: "small" | "medium" | "large";
|
|
4
5
|
variant?: "text" | "outlined" | "filled" | "filledtonal" | "tonal" | "elevated" | "link" | "fab";
|
|
5
6
|
borderStyle?: "none" | "semi" | "squircle" | "rounded";
|
|
6
|
-
icon?:
|
|
7
|
+
icon?: iconsCode;
|
|
7
8
|
iconPosition?: "start" | "end";
|
|
8
9
|
loadingPosition?: "auto" | "center";
|
|
9
10
|
loadingVariant?: "scaleOut" | "dots" | "spinner";
|
package/button/button.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { joinClassNames } from "@yakad/lib";
|
|
3
|
-
import SvgIcon from "../svgIcon/svgIcon";
|
|
4
3
|
import Loading from "../loading/loading";
|
|
5
4
|
import styles from "./button.module.css";
|
|
5
|
+
import Symbol from "@yakad/symbols";
|
|
6
6
|
const iconSizeMaps = {
|
|
7
7
|
small: 2,
|
|
8
8
|
medium: 2.4,
|
|
@@ -19,9 +19,9 @@ export default function Button(props) {
|
|
|
19
19
|
startWithChildren ? props.children : null,
|
|
20
20
|
props.loadingVariant ? (React.createElement("div", { className: joinClassNames(centerLoading ? styles.positionCenter : "", styles.displayOnDisabled) },
|
|
21
21
|
React.createElement(Loading, { size: props.size, variant: props.loadingVariant }))) : null,
|
|
22
|
-
props.icon ? (React.createElement(
|
|
22
|
+
props.icon ? (React.createElement(Symbol, { className: styles.hideOnDisabled, size: props.size
|
|
23
23
|
? iconSizeMaps[props.size]
|
|
24
|
-
: iconSizeMaps.medium
|
|
24
|
+
: iconSizeMaps.medium, icon: [props.icon] })) : null,
|
|
25
25
|
!startWithChildren ? props.children : null));
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=button.js.map
|
package/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AA2BpC,MAAM,YAAY,GAAgB;IAC9B,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;CACb,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC7C,MAAM,iBAAiB,GAAG,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC;IACvD,MAAM,aAAa,GACf,CAAC,KAAK,CAAC,IAAI;QACX,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC;IAEjE,MAAM,gBAAgB,GAAG,cAAc,CACnC,MAAM,CAAC,MAAM,EACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,M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AAY,CAAC,MAAM,EAE7B,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GACpB,CACL,CAAC,CAAC,CAAC,IAAI;QACP,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CACtC,CACZ,CAAC;AACN,CAAC"}
|
package/button/button.module.css
CHANGED
package/button/button.tsx
CHANGED
|
@@ -3,6 +3,8 @@ import { joinClassNames } from "@yakad/lib";
|
|
|
3
3
|
import SvgIcon from "../svgIcon/svgIcon";
|
|
4
4
|
import Loading from "../loading/loading";
|
|
5
5
|
import styles from "./button.module.css";
|
|
6
|
+
import { iconsCode } from "@yakad/symbols/types";
|
|
7
|
+
import Symbol from "@yakad/symbols";
|
|
6
8
|
|
|
7
9
|
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
8
10
|
size?: "small" | "medium" | "large";
|
|
@@ -16,7 +18,7 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
16
18
|
| "link"
|
|
17
19
|
| "fab";
|
|
18
20
|
borderStyle?: "none" | "semi" | "squircle" | "rounded";
|
|
19
|
-
icon?:
|
|
21
|
+
icon?: iconsCode;
|
|
20
22
|
iconPosition?: "start" | "end";
|
|
21
23
|
loadingPosition?: "auto" | "center";
|
|
22
24
|
loadingVariant?: "scaleOut" | "dots" | "spinner";
|
|
@@ -68,16 +70,15 @@ export default function Button(props: ButtonProps) {
|
|
|
68
70
|
</div>
|
|
69
71
|
) : null}
|
|
70
72
|
{props.icon ? (
|
|
71
|
-
<
|
|
73
|
+
<Symbol
|
|
72
74
|
className={styles.hideOnDisabled}
|
|
73
75
|
size={
|
|
74
76
|
props.size
|
|
75
77
|
? iconSizeMaps[props.size]
|
|
76
78
|
: iconSizeMaps.medium
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</SvgIcon>
|
|
80
|
+
icon={[props.icon]}
|
|
81
|
+
/>
|
|
81
82
|
) : null}
|
|
82
83
|
{!startWithChildren ? props.children : null}
|
|
83
84
|
</button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yakad/ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.99-beta",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@types/react": "18.0.24",
|
|
22
22
|
"@types/react-dom": "18.0.6",
|
|
23
23
|
"@yakad/lib": "1.0.5",
|
|
24
|
+
"@yakad/symbols": "^1.0.1",
|
|
24
25
|
"react": "18.2.0",
|
|
25
26
|
"react-dom": "18.2.0",
|
|
26
27
|
"typescript": "4.8.4"
|
package/types.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import { MainProps } from "./main/main";
|
|
|
12
12
|
import { NavigationProps } from "./navigation/navigation";
|
|
13
13
|
import { SvgIconProps } from "./svgIcon/svgIcon";
|
|
14
14
|
import { ThemeProps } from "./theme/theme";
|
|
15
|
+
|
|
15
16
|
export {
|
|
16
17
|
type ButtonProps,
|
|
17
18
|
type ClickAwayListenerProps,
|