@korsolutions/ui 0.0.60 → 0.0.61
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/dist/module/components/button/variants/ghost.js +59 -0
- package/dist/module/components/button/variants/ghost.js.map +1 -0
- package/dist/module/components/button/variants/index.js +3 -1
- package/dist/module/components/button/variants/index.js.map +1 -1
- package/dist/module/components/icon-button/icon-button.js +63 -0
- package/dist/module/components/icon-button/icon-button.js.map +1 -0
- package/dist/module/components/icon-button/index.js +4 -0
- package/dist/module/components/icon-button/index.js.map +1 -0
- package/dist/module/components/icon-button/types.js +4 -0
- package/dist/module/components/icon-button/types.js.map +1 -0
- package/dist/module/components/icon-button/variants/default.js +34 -0
- package/dist/module/components/icon-button/variants/default.js.map +1 -0
- package/dist/module/components/icon-button/variants/ghost.js +35 -0
- package/dist/module/components/icon-button/variants/ghost.js.map +1 -0
- package/dist/module/components/icon-button/variants/index.js +11 -0
- package/dist/module/components/icon-button/variants/index.js.map +1 -0
- package/dist/module/components/icon-button/variants/secondary.js +37 -0
- package/dist/module/components/icon-button/variants/secondary.js.map +1 -0
- package/dist/module/components/index.js +2 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/separator/index.js +4 -0
- package/dist/module/components/separator/index.js.map +1 -0
- package/dist/module/components/separator/separator.js +17 -0
- package/dist/module/components/separator/separator.js.map +1 -0
- package/dist/module/components/separator/types.js +4 -0
- package/dist/module/components/separator/types.js.map +1 -0
- package/dist/module/components/separator/variants/horizontal.js +15 -0
- package/dist/module/components/separator/variants/horizontal.js.map +1 -0
- package/dist/module/components/separator/variants/index.js +9 -0
- package/dist/module/components/separator/variants/index.js.map +1 -0
- package/dist/module/components/separator/variants/vertical.js +15 -0
- package/dist/module/components/separator/variants/vertical.js.map +1 -0
- package/dist/typescript/src/components/button/variants/ghost.d.ts +3 -0
- package/dist/typescript/src/components/button/variants/ghost.d.ts.map +1 -0
- package/dist/typescript/src/components/button/variants/index.d.ts +1 -0
- package/dist/typescript/src/components/button/variants/index.d.ts.map +1 -1
- package/dist/typescript/src/components/icon-button/icon-button.d.ts +15 -0
- package/dist/typescript/src/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/index.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/index.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/types.d.ts +8 -0
- package/dist/typescript/src/components/icon-button/types.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/ghost.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/variants/ghost.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/index.d.ts +6 -0
- package/dist/typescript/src/components/icon-button/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/secondary.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/variants/secondary.d.ts.map +1 -0
- package/dist/typescript/src/components/index.d.ts +2 -0
- package/dist/typescript/src/components/index.d.ts.map +1 -1
- package/dist/typescript/src/components/separator/index.d.ts +3 -0
- package/dist/typescript/src/components/separator/index.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/separator.d.ts +9 -0
- package/dist/typescript/src/components/separator/separator.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/types.d.ts +5 -0
- package/dist/typescript/src/components/separator/types.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/variants/horizontal.d.ts +3 -0
- package/dist/typescript/src/components/separator/variants/horizontal.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/separator/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/variants/vertical.d.ts +3 -0
- package/dist/typescript/src/components/separator/variants/vertical.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/button/variants/ghost.tsx +55 -0
- package/src/components/button/variants/index.ts +2 -0
- package/src/components/icon-button/icon-button.tsx +92 -0
- package/src/components/icon-button/index.ts +2 -0
- package/src/components/icon-button/types.ts +9 -0
- package/src/components/icon-button/variants/default.tsx +32 -0
- package/src/components/icon-button/variants/ghost.tsx +33 -0
- package/src/components/icon-button/variants/index.ts +9 -0
- package/src/components/icon-button/variants/secondary.tsx +35 -0
- package/src/components/index.ts +2 -0
- package/src/components/separator/index.ts +2 -0
- package/src/components/separator/separator.tsx +15 -0
- package/src/components/separator/types.ts +5 -0
- package/src/components/separator/variants/horizontal.tsx +14 -0
- package/src/components/separator/variants/index.ts +7 -0
- package/src/components/separator/variants/vertical.tsx +14 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils.js";
|
|
4
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles.js";
|
|
5
|
+
export const useButtonVariantGhost = () => {
|
|
6
|
+
return useThemedStyles(({
|
|
7
|
+
colors,
|
|
8
|
+
radius,
|
|
9
|
+
fontFamily,
|
|
10
|
+
fontSize
|
|
11
|
+
}) => ({
|
|
12
|
+
root: {
|
|
13
|
+
default: {
|
|
14
|
+
flexDirection: "row",
|
|
15
|
+
paddingVertical: 12,
|
|
16
|
+
paddingHorizontal: 16,
|
|
17
|
+
borderRadius: radius,
|
|
18
|
+
gap: 8,
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
backgroundColor: "transparent"
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
opacity: 0.5
|
|
25
|
+
},
|
|
26
|
+
loading: {
|
|
27
|
+
opacity: 0.5
|
|
28
|
+
},
|
|
29
|
+
hovered: {
|
|
30
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1)
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
label: {
|
|
34
|
+
default: {
|
|
35
|
+
color: colors.foreground,
|
|
36
|
+
fontSize,
|
|
37
|
+
fontFamily
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
color: colors.mutedForeground
|
|
41
|
+
},
|
|
42
|
+
loading: {
|
|
43
|
+
color: colors.mutedForeground
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
spinner: {
|
|
47
|
+
default: {
|
|
48
|
+
color: colors.foreground
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
color: colors.mutedForeground
|
|
52
|
+
},
|
|
53
|
+
loading: {
|
|
54
|
+
color: colors.mutedForeground
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=ghost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hslaSetRelativeLightness","useThemedStyles","useButtonVariantGhost","colors","radius","fontFamily","fontSize","root","default","flexDirection","paddingVertical","paddingHorizontal","borderRadius","gap","alignItems","justifyContent","backgroundColor","disabled","opacity","loading","hovered","secondary","label","color","foreground","mutedForeground","spinner"],"sourceRoot":"../../../../../src","sources":["components/button/variants/ghost.tsx"],"mappings":";;AACA,SAASA,wBAAwB,QAAQ,8BAA2B;AACpE,SAASC,eAAe,QAAQ,qCAAkC;AAElE,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAoB;EACvD,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,MAAoB;IAC3DC,IAAI,EAAE;MACJC,OAAO,EAAE;QACPC,aAAa,EAAE,KAAK;QACpBC,eAAe,EAAE,EAAE;QACnBC,iBAAiB,EAAE,EAAE;QACrBC,YAAY,EAAER,MAAM;QACpBS,GAAG,EAAE,CAAC;QACNC,UAAU,EAAE,QAAQ;QACpBC,cAAc,EAAE,QAAQ;QACxBC,eAAe,EAAE;MACnB,CAAC;MACDC,QAAQ,EAAE;QACRC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPD,OAAO,EAAE;MACX,CAAC;MACDE,OAAO,EAAE;QACPJ,eAAe,EAAEhB,wBAAwB,CAACG,MAAM,CAACkB,SAAS,EAAE,CAAC,CAAC;MAChE;IACF,CAAC;IACDC,KAAK,EAAE;MACLd,OAAO,EAAE;QACPe,KAAK,EAAEpB,MAAM,CAACqB,UAAU;QACxBlB,QAAQ;QACRD;MACF,CAAC;MACDY,QAAQ,EAAE;QACRM,KAAK,EAAEpB,MAAM,CAACsB;MAChB,CAAC;MACDN,OAAO,EAAE;QACPI,KAAK,EAAEpB,MAAM,CAACsB;MAChB;IACF,CAAC;IACDC,OAAO,EAAE;MACPlB,OAAO,EAAE;QACPe,KAAK,EAAEpB,MAAM,CAACqB;MAChB,CAAC;MACDP,QAAQ,EAAE;QACRM,KAAK,EAAEpB,MAAM,CAACsB;MAChB,CAAC;MACDN,OAAO,EAAE;QACPI,KAAK,EAAEpB,MAAM,CAACsB;MAChB;IACF;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useButtonVariantDefault } from "./default.js";
|
|
4
|
+
import { useButtonVariantGhost } from "./ghost.js";
|
|
4
5
|
import { useButtonVariantSecondary } from "./secondary.js";
|
|
5
6
|
export const ButtonVariants = {
|
|
6
7
|
default: useButtonVariantDefault,
|
|
7
|
-
secondary: useButtonVariantSecondary
|
|
8
|
+
secondary: useButtonVariantSecondary,
|
|
9
|
+
ghost: useButtonVariantGhost
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useButtonVariantDefault","useButtonVariantSecondary","ButtonVariants","default","secondary"],"sourceRoot":"../../../../../src","sources":["components/button/variants/index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,cAAW;AACnD,SAASC,yBAAyB,QAAQ,gBAAa;AAEvD,OAAO,MAAMC,cAAc,GAAG;EAC5BC,OAAO,
|
|
1
|
+
{"version":3,"names":["useButtonVariantDefault","useButtonVariantGhost","useButtonVariantSecondary","ButtonVariants","default","secondary","ghost"],"sourceRoot":"../../../../../src","sources":["components/button/variants/index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,cAAW;AACnD,SAASC,qBAAqB,QAAQ,YAAS;AAC/C,SAASC,yBAAyB,QAAQ,gBAAa;AAEvD,OAAO,MAAMC,cAAc,GAAG;EAC5BC,OAAO,EAAEJ,uBAAuB;EAChCK,SAAS,EAAEH,yBAAyB;EACpCI,KAAK,EAAEL;AACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { Pressable } from "react-native";
|
|
5
|
+
import { IconButtonVariants } from "./variants/index.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const calculateState = (props, isHovered) => {
|
|
8
|
+
if (props.isDisabled) return "disabled";
|
|
9
|
+
if (isHovered) return "hovered";
|
|
10
|
+
return "default";
|
|
11
|
+
};
|
|
12
|
+
const cursorValue = state => {
|
|
13
|
+
if (state === "disabled") return "not-allowed";
|
|
14
|
+
return "pointer";
|
|
15
|
+
};
|
|
16
|
+
export function IconButton(props) {
|
|
17
|
+
const {
|
|
18
|
+
render: IconComponent,
|
|
19
|
+
variant = "default",
|
|
20
|
+
isDisabled,
|
|
21
|
+
size,
|
|
22
|
+
color,
|
|
23
|
+
strokeWidth,
|
|
24
|
+
style,
|
|
25
|
+
...rest
|
|
26
|
+
} = props;
|
|
27
|
+
const variantStyles = IconButtonVariants[variant]();
|
|
28
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
29
|
+
const state = calculateState(props, isHovered);
|
|
30
|
+
const handlePress = event => {
|
|
31
|
+
if (isDisabled) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
rest.onPress?.(event);
|
|
36
|
+
};
|
|
37
|
+
const iconProps = {
|
|
38
|
+
size: size ?? variantStyles.icon?.default?.size,
|
|
39
|
+
color: color ?? variantStyles.icon?.[state]?.color ?? variantStyles.icon?.default?.color,
|
|
40
|
+
strokeWidth,
|
|
41
|
+
absoluteStrokeWidth: true
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
44
|
+
...rest,
|
|
45
|
+
onPress: handlePress,
|
|
46
|
+
onHoverIn: e => {
|
|
47
|
+
setIsHovered(true);
|
|
48
|
+
rest.onHoverIn?.(e);
|
|
49
|
+
},
|
|
50
|
+
onHoverOut: e => {
|
|
51
|
+
setIsHovered(false);
|
|
52
|
+
rest.onHoverOut?.(e);
|
|
53
|
+
},
|
|
54
|
+
disabled: isDisabled,
|
|
55
|
+
style: [variantStyles.root?.default, variantStyles.root?.[state], {
|
|
56
|
+
cursor: cursorValue(state)
|
|
57
|
+
}, style],
|
|
58
|
+
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
59
|
+
...iconProps
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","Pressable","IconButtonVariants","jsx","_jsx","calculateState","props","isHovered","isDisabled","cursorValue","state","IconButton","render","IconComponent","variant","size","color","strokeWidth","style","rest","variantStyles","setIsHovered","handlePress","event","preventDefault","onPress","iconProps","icon","default","absoluteStrokeWidth","onHoverIn","e","onHoverOut","disabled","root","cursor","children"],"sourceRoot":"../../../../src","sources":["components/icon-button/icon-button.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,SAAS,QAKJ,cAAc;AAGrB,SAASC,kBAAkB,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAahD,MAAMC,cAAc,GAAGA,CACrBC,KAAsB,EACtBC,SAAkB,KACE;EACpB,IAAID,KAAK,CAACE,UAAU,EAAE,OAAO,UAAU;EACvC,IAAID,SAAS,EAAE,OAAO,SAAS;EAC/B,OAAO,SAAS;AAClB,CAAC;AAED,MAAME,WAAW,GAAIC,KAAsB,IAAkB;EAC3D,IAAIA,KAAK,KAAK,UAAU,EAAE,OAAO,aAAa;EAC9C,OAAO,SAAS;AAClB,CAAC;AAED,OAAO,SAASC,UAAUA,CAACL,KAAsB,EAAE;EACjD,MAAM;IACJM,MAAM,EAAEC,aAAa;IACrBC,OAAO,GAAG,SAAS;IACnBN,UAAU;IACVO,IAAI;IACJC,KAAK;IACLC,WAAW;IACXC,KAAK;IACL,GAAGC;EACL,CAAC,GAAGb,KAAK;EAET,MAAMc,aAAa,GAAGlB,kBAAkB,CAACY,OAAO,CAAC,CAAC,CAAC;EACnD,MAAM,CAACP,SAAS,EAAEc,YAAY,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAMU,KAAK,GAAGL,cAAc,CAACC,KAAK,EAAEC,SAAS,CAAC;EAE9C,MAAMe,WAAsC,GAAIC,KAAK,IAAK;IACxD,IAAIf,UAAU,EAAE;MACde,KAAK,CAACC,cAAc,CAAC,CAAC;MACtB;IACF;IACAL,IAAI,CAACM,OAAO,GAAGF,KAAK,CAAC;EACvB,CAAC;EAED,MAAMG,SAAmB,GAAG;IAC1BX,IAAI,EAAEA,IAAI,IAAIK,aAAa,CAACO,IAAI,EAAEC,OAAO,EAAEb,IAAI;IAC/CC,KAAK,EAAEA,KAAK,IAAII,aAAa,CAACO,IAAI,GAAGjB,KAAK,CAAC,EAAEM,KAAK,IAAII,aAAa,CAACO,IAAI,EAAEC,OAAO,EAAEZ,KAAK;IACxFC,WAAW;IACXY,mBAAmB,EAAE;EACvB,CAAC;EAED,oBACEzB,IAAA,CAACH,SAAS;IAAA,GACJkB,IAAI;IACRM,OAAO,EAAEH,WAAY;IACrBQ,SAAS,EAAGC,CAAC,IAAK;MAChBV,YAAY,CAAC,IAAI,CAAC;MAClBF,IAAI,CAACW,SAAS,GAAGC,CAAC,CAAC;IACrB,CAAE;IACFC,UAAU,EAAGD,CAAC,IAAK;MACjBV,YAAY,CAAC,KAAK,CAAC;MACnBF,IAAI,CAACa,UAAU,GAAGD,CAAC,CAAC;IACtB,CAAE;IACFE,QAAQ,EAAEzB,UAAW;IACrBU,KAAK,EAAE,CACLE,aAAa,CAACc,IAAI,EAAEN,OAAO,EAC3BR,aAAa,CAACc,IAAI,GAAGxB,KAAK,CAAC,EAC3B;MAAEyB,MAAM,EAAE1B,WAAW,CAACC,KAAK;IAAE,CAAC,EAC9BQ,KAAK,CACL;IAAAkB,QAAA,eAEFhC,IAAA,CAACS,aAAa;MAAA,GAAKa;IAAS,CAAG;EAAC,CACvB,CAAC;AAEhB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IconButton"],"sourceRoot":"../../../../src","sources":["components/icon-button/index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAA8B,kBAAe","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/icon-button/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils.js";
|
|
4
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles.js";
|
|
5
|
+
export const useIconButtonVariantDefault = () => {
|
|
6
|
+
return useThemedStyles(({
|
|
7
|
+
colors,
|
|
8
|
+
radius
|
|
9
|
+
}) => ({
|
|
10
|
+
root: {
|
|
11
|
+
default: {
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
padding: 8,
|
|
15
|
+
borderRadius: radius,
|
|
16
|
+
backgroundColor: colors.primary,
|
|
17
|
+
borderWidth: 1,
|
|
18
|
+
borderColor: colors.border
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
opacity: 0.5
|
|
22
|
+
},
|
|
23
|
+
hovered: {
|
|
24
|
+
backgroundColor: hslaSetRelativeLightness(colors.primary, -10)
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
default: {
|
|
29
|
+
color: colors.primaryForeground
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hslaSetRelativeLightness","useThemedStyles","useIconButtonVariantDefault","colors","radius","root","default","alignItems","justifyContent","padding","borderRadius","backgroundColor","primary","borderWidth","borderColor","border","disabled","opacity","hovered","icon","color","primaryForeground"],"sourceRoot":"../../../../../src","sources":["components/icon-button/variants/default.tsx"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,8BAA2B;AACpE,SAASC,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,MAAMC,2BAA2B,GAAGA,CAAA,KAAwB;EACjE,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC;EAAO,CAAC,MAAwB;IACzCC,IAAI,EAAE;MACJC,OAAO,EAAE;QACPC,UAAU,EAAE,QAAQ;QACpBC,cAAc,EAAE,QAAQ;QACxBC,OAAO,EAAE,CAAC;QACVC,YAAY,EAAEN,MAAM;QACpBO,eAAe,EAAER,MAAM,CAACS,OAAO;QAC/BC,WAAW,EAAE,CAAC;QACdC,WAAW,EAAEX,MAAM,CAACY;MACtB,CAAC;MACDC,QAAQ,EAAE;QACRC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPP,eAAe,EAAEX,wBAAwB,CAACG,MAAM,CAACS,OAAO,EAAE,CAAC,EAAE;MAC/D;IACF,CAAC;IACDO,IAAI,EAAE;MACJb,OAAO,EAAE;QACPc,KAAK,EAAEjB,MAAM,CAACkB;MAChB;IACF;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils.js";
|
|
4
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles.js";
|
|
5
|
+
export const useIconButtonVariantGhost = () => {
|
|
6
|
+
return useThemedStyles(({
|
|
7
|
+
colors,
|
|
8
|
+
radius
|
|
9
|
+
}) => ({
|
|
10
|
+
root: {
|
|
11
|
+
default: {
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
padding: 8,
|
|
15
|
+
borderRadius: radius,
|
|
16
|
+
backgroundColor: "transparent"
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
opacity: 0.5
|
|
20
|
+
},
|
|
21
|
+
hovered: {
|
|
22
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1)
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
default: {
|
|
27
|
+
color: colors.foreground
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
color: colors.mutedForeground
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=ghost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hslaSetRelativeLightness","useThemedStyles","useIconButtonVariantGhost","colors","radius","root","default","alignItems","justifyContent","padding","borderRadius","backgroundColor","disabled","opacity","hovered","secondary","icon","color","foreground","mutedForeground"],"sourceRoot":"../../../../../src","sources":["components/icon-button/variants/ghost.tsx"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,8BAA2B;AACpE,SAASC,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAwB;EAC/D,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC;EAAO,CAAC,MAAwB;IACzCC,IAAI,EAAE;MACJC,OAAO,EAAE;QACPC,UAAU,EAAE,QAAQ;QACpBC,cAAc,EAAE,QAAQ;QACxBC,OAAO,EAAE,CAAC;QACVC,YAAY,EAAEN,MAAM;QACpBO,eAAe,EAAE;MACnB,CAAC;MACDC,QAAQ,EAAE;QACRC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPH,eAAe,EAAEX,wBAAwB,CAACG,MAAM,CAACY,SAAS,EAAE,CAAC,CAAC;MAChE;IACF,CAAC;IACDC,IAAI,EAAE;MACJV,OAAO,EAAE;QACPW,KAAK,EAAEd,MAAM,CAACe;MAChB,CAAC;MACDN,QAAQ,EAAE;QACRK,KAAK,EAAEd,MAAM,CAACgB;MAChB;IACF;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useIconButtonVariantDefault } from "./default.js";
|
|
4
|
+
import { useIconButtonVariantGhost } from "./ghost.js";
|
|
5
|
+
import { useIconButtonVariantSecondary } from "./secondary.js";
|
|
6
|
+
export const IconButtonVariants = {
|
|
7
|
+
default: useIconButtonVariantDefault,
|
|
8
|
+
secondary: useIconButtonVariantSecondary,
|
|
9
|
+
ghost: useIconButtonVariantGhost
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useIconButtonVariantDefault","useIconButtonVariantGhost","useIconButtonVariantSecondary","IconButtonVariants","default","secondary","ghost"],"sourceRoot":"../../../../../src","sources":["components/icon-button/variants/index.ts"],"mappings":";;AAAA,SAASA,2BAA2B,QAAQ,cAAW;AACvD,SAASC,yBAAyB,QAAQ,YAAS;AACnD,SAASC,6BAA6B,QAAQ,gBAAa;AAE3D,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,OAAO,EAAEJ,2BAA2B;EACpCK,SAAS,EAAEH,6BAA6B;EACxCI,KAAK,EAAEL;AACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils.js";
|
|
4
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles.js";
|
|
5
|
+
export const useIconButtonVariantSecondary = () => {
|
|
6
|
+
return useThemedStyles(({
|
|
7
|
+
colors,
|
|
8
|
+
radius
|
|
9
|
+
}) => ({
|
|
10
|
+
root: {
|
|
11
|
+
default: {
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
padding: 8,
|
|
15
|
+
borderRadius: radius,
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
borderColor: colors.border,
|
|
18
|
+
backgroundColor: colors.secondary
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
opacity: 0.5
|
|
22
|
+
},
|
|
23
|
+
hovered: {
|
|
24
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1)
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
default: {
|
|
29
|
+
color: colors.secondaryForeground
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
color: colors.mutedForeground
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=secondary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hslaSetRelativeLightness","useThemedStyles","useIconButtonVariantSecondary","colors","radius","root","default","alignItems","justifyContent","padding","borderRadius","borderWidth","borderColor","border","backgroundColor","secondary","disabled","opacity","hovered","icon","color","secondaryForeground","mutedForeground"],"sourceRoot":"../../../../../src","sources":["components/icon-button/variants/secondary.tsx"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,8BAA2B;AACpE,SAASC,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,MAAMC,6BAA6B,GAAGA,CAAA,KAAwB;EACnE,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC;EAAO,CAAC,MAAwB;IACzCC,IAAI,EAAE;MACJC,OAAO,EAAE;QACPC,UAAU,EAAE,QAAQ;QACpBC,cAAc,EAAE,QAAQ;QACxBC,OAAO,EAAE,CAAC;QACVC,YAAY,EAAEN,MAAM;QACpBO,WAAW,EAAE,CAAC;QACdC,WAAW,EAAET,MAAM,CAACU,MAAM;QAC1BC,eAAe,EAAEX,MAAM,CAACY;MAC1B,CAAC;MACDC,QAAQ,EAAE;QACRC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPJ,eAAe,EAAEd,wBAAwB,CAACG,MAAM,CAACY,SAAS,EAAE,CAAC,CAAC;MAChE;IACF,CAAC;IACDI,IAAI,EAAE;MACJb,OAAO,EAAE;QACPc,KAAK,EAAEjB,MAAM,CAACkB;MAChB,CAAC;MACDL,QAAQ,EAAE;QACRI,KAAK,EAAEjB,MAAM,CAACmB;MAChB;IACF;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ export * from "./checkbox/index.js";
|
|
|
11
11
|
export * from "./empty/index.js";
|
|
12
12
|
export * from "./field/index.js";
|
|
13
13
|
export * from "./icon/index.js";
|
|
14
|
+
export * from "./icon-button/index.js";
|
|
14
15
|
export * from "./input/index.js";
|
|
15
16
|
export * from "./link/index.js";
|
|
16
17
|
export * from "./list/index.js";
|
|
@@ -21,6 +22,7 @@ export * from "./portal/index.js";
|
|
|
21
22
|
export * from "./progress/index.js";
|
|
22
23
|
export * from "./scroll-bar/index.js";
|
|
23
24
|
export * from "./select/index.js";
|
|
25
|
+
export * from "./separator/index.js";
|
|
24
26
|
export * from "./tabs/index.js";
|
|
25
27
|
export * from "./textarea/index.js";
|
|
26
28
|
export * from "./toast/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,kBAAS;AACvB,cAAc,yBAAgB;AAC9B,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,iBAAQ;AACtB,cAAc,kBAAS;AACvB,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,uBAAc;AAC5B,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,uBAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,kBAAS;AACvB,cAAc,yBAAgB;AAC9B,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,uBAAc;AAC5B,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,uBAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Separator"],"sourceRoot":"../../../../src","sources":["components/separator/index.ts"],"mappings":";;AAAA,SAASA,SAAS,QAA6B,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { SeparatorVariants } from "./variants/index.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export function Separator(props) {
|
|
8
|
+
const {
|
|
9
|
+
variant = "horizontal",
|
|
10
|
+
style
|
|
11
|
+
} = props;
|
|
12
|
+
const variantStyles = SeparatorVariants[variant]();
|
|
13
|
+
return /*#__PURE__*/_jsx(View, {
|
|
14
|
+
style: [variantStyles.root, style]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","SeparatorVariants","jsx","_jsx","Separator","props","variant","style","variantStyles","root"],"sourceRoot":"../../../../src","sources":["components/separator/separator.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAwC,cAAc;AACnE,SAASC,iBAAiB,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAO/C,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAM;IAAEC,OAAO,GAAG,YAAY;IAAEC;EAAM,CAAC,GAAGF,KAAK;EAC/C,MAAMG,aAAa,GAAGP,iBAAiB,CAACK,OAAO,CAAC,CAAC,CAAC;EAElD,oBAAOH,IAAA,CAACH,IAAI;IAACO,KAAK,EAAE,CAACC,aAAa,CAACC,IAAI,EAAEF,KAAK;EAAE,CAAE,CAAC;AACrD","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/separator/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles.js";
|
|
4
|
+
export const useSeparatorVariantHorizontal = () => {
|
|
5
|
+
return useThemedStyles(({
|
|
6
|
+
colors
|
|
7
|
+
}) => ({
|
|
8
|
+
root: {
|
|
9
|
+
height: 1,
|
|
10
|
+
alignSelf: "stretch",
|
|
11
|
+
backgroundColor: colors.border
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=horizontal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useThemedStyles","useSeparatorVariantHorizontal","colors","root","height","alignSelf","backgroundColor","border"],"sourceRoot":"../../../../../src","sources":["components/separator/variants/horizontal.tsx"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,MAAMC,6BAA6B,GAAGA,CAAA,KAAuB;EAClE,OAAOD,eAAe,CACpB,CAAC;IAAEE;EAAO,CAAC,MAAuB;IAChCC,IAAI,EAAE;MACJC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAE,SAAS;MACpBC,eAAe,EAAEJ,MAAM,CAACK;IAC1B;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useSeparatorVariantHorizontal } from "./horizontal.js";
|
|
4
|
+
import { useSeparatorVariantVertical } from "./vertical.js";
|
|
5
|
+
export const SeparatorVariants = {
|
|
6
|
+
horizontal: useSeparatorVariantHorizontal,
|
|
7
|
+
vertical: useSeparatorVariantVertical
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSeparatorVariantHorizontal","useSeparatorVariantVertical","SeparatorVariants","horizontal","vertical"],"sourceRoot":"../../../../../src","sources":["components/separator/variants/index.ts"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,iBAAc;AAC5D,SAASC,2BAA2B,QAAQ,eAAY;AAExD,OAAO,MAAMC,iBAAiB,GAAG;EAC/BC,UAAU,EAAEH,6BAA6B;EACzCI,QAAQ,EAAEH;AACZ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles.js";
|
|
4
|
+
export const useSeparatorVariantVertical = () => {
|
|
5
|
+
return useThemedStyles(({
|
|
6
|
+
colors
|
|
7
|
+
}) => ({
|
|
8
|
+
root: {
|
|
9
|
+
width: 1,
|
|
10
|
+
alignSelf: "stretch",
|
|
11
|
+
backgroundColor: colors.border
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=vertical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useThemedStyles","useSeparatorVariantVertical","colors","root","width","alignSelf","backgroundColor","border"],"sourceRoot":"../../../../../src","sources":["components/separator/variants/vertical.tsx"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,MAAMC,2BAA2B,GAAGA,CAAA,KAAuB;EAChE,OAAOD,eAAe,CACpB,CAAC;IAAEE;EAAO,CAAC,MAAuB;IAChCC,IAAI,EAAE;MACJC,KAAK,EAAE,CAAC;MACRC,SAAS,EAAE,SAAS;MACpBC,eAAe,EAAEJ,MAAM,CAACK;IAC1B;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ghost.d.ts","sourceRoot":"","sources":["../../../../../../src/components/button/variants/ghost.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,eAAO,MAAM,qBAAqB,QAAO,YAkDxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/button/variants/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/button/variants/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;CAI1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type PressableProps, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import type { SvgProps } from "../../types/props.types";
|
|
4
|
+
import { IconButtonVariants } from "./variants";
|
|
5
|
+
export interface IconButtonProps extends Omit<PressableProps, "disabled" | "children"> {
|
|
6
|
+
render: (props: SvgProps) => React.ReactNode;
|
|
7
|
+
variant?: keyof typeof IconButtonVariants;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
size?: number;
|
|
10
|
+
color?: SvgProps["color"];
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
export declare function IconButton(props: IconButtonProps): React.JSX.Element;
|
|
15
|
+
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,UAAU,CAAC;IACrD,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,OAAO,kBAAkB,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAgBD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAsDhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import type { SvgProps } from "../../types/props.types";
|
|
3
|
+
export type IconButtonState = "default" | "disabled" | "hovered";
|
|
4
|
+
export interface IconButtonStyles {
|
|
5
|
+
root?: Partial<Record<IconButtonState, StyleProp<ViewStyle>>>;
|
|
6
|
+
icon?: Partial<Record<IconButtonState, SvgProps>>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/icon-button/variants/default.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,2BAA2B,QAAO,gBA2B9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ghost.d.ts","sourceRoot":"","sources":["../../../../../../src/components/icon-button/variants/ghost.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,yBAAyB,QAAO,gBA4B5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/icon-button/variants/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/icon-button/variants/secondary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,6BAA6B,QAAO,gBA8BhD,CAAC"}
|
|
@@ -9,6 +9,7 @@ export * from "./checkbox";
|
|
|
9
9
|
export * from "./empty";
|
|
10
10
|
export * from "./field";
|
|
11
11
|
export * from "./icon";
|
|
12
|
+
export * from "./icon-button";
|
|
12
13
|
export * from "./input";
|
|
13
14
|
export * from "./link";
|
|
14
15
|
export * from "./list";
|
|
@@ -19,6 +20,7 @@ export * from "./portal";
|
|
|
19
20
|
export * from "./progress";
|
|
20
21
|
export * from "./scroll-bar";
|
|
21
22
|
export * from "./select";
|
|
23
|
+
export * from "./separator";
|
|
22
24
|
export * from "./tabs";
|
|
23
25
|
export * from "./textarea";
|
|
24
26
|
export * from "./toast";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { SeparatorVariants } from "./variants";
|
|
4
|
+
export interface SeparatorProps {
|
|
5
|
+
variant?: keyof typeof SeparatorVariants;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
}
|
|
8
|
+
export declare function Separator(props: SeparatorProps): React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,OAAO,iBAAiB,CAAC;IACzC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAK9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"horizontal.d.ts","sourceRoot":"","sources":["../../../../../../src/components/separator/variants/horizontal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,6BAA6B,QAAO,eAUhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/separator/variants/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical.d.ts","sourceRoot":"","sources":["../../../../../../src/components/separator/variants/vertical.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,2BAA2B,QAAO,eAU9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ButtonStyles } from "../..";
|
|
2
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
3
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
4
|
+
|
|
5
|
+
export const useButtonVariantGhost = (): ButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius, fontFamily, fontSize }): ButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
paddingVertical: 12,
|
|
12
|
+
paddingHorizontal: 16,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
gap: 8,
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
backgroundColor: "transparent",
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
opacity: 0.5,
|
|
21
|
+
},
|
|
22
|
+
loading: {
|
|
23
|
+
opacity: 0.5,
|
|
24
|
+
},
|
|
25
|
+
hovered: {
|
|
26
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
label: {
|
|
30
|
+
default: {
|
|
31
|
+
color: colors.foreground,
|
|
32
|
+
fontSize,
|
|
33
|
+
fontFamily,
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
color: colors.mutedForeground,
|
|
37
|
+
},
|
|
38
|
+
loading: {
|
|
39
|
+
color: colors.mutedForeground,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
spinner: {
|
|
43
|
+
default: {
|
|
44
|
+
color: colors.foreground,
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
color: colors.mutedForeground,
|
|
48
|
+
},
|
|
49
|
+
loading: {
|
|
50
|
+
color: colors.mutedForeground,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useButtonVariantDefault } from "./default";
|
|
2
|
+
import { useButtonVariantGhost } from "./ghost";
|
|
2
3
|
import { useButtonVariantSecondary } from "./secondary";
|
|
3
4
|
|
|
4
5
|
export const ButtonVariants = {
|
|
5
6
|
default: useButtonVariantDefault,
|
|
6
7
|
secondary: useButtonVariantSecondary,
|
|
8
|
+
ghost: useButtonVariantGhost,
|
|
7
9
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type CursorValue,
|
|
5
|
+
type PressableProps,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import type { SvgProps } from "../../types/props.types";
|
|
10
|
+
import type { IconButtonState } from "./types";
|
|
11
|
+
import { IconButtonVariants } from "./variants";
|
|
12
|
+
|
|
13
|
+
export interface IconButtonProps
|
|
14
|
+
extends Omit<PressableProps, "disabled" | "children"> {
|
|
15
|
+
render: (props: SvgProps) => React.ReactNode;
|
|
16
|
+
variant?: keyof typeof IconButtonVariants;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
size?: number;
|
|
19
|
+
color?: SvgProps["color"];
|
|
20
|
+
strokeWidth?: number;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const calculateState = (
|
|
25
|
+
props: IconButtonProps,
|
|
26
|
+
isHovered: boolean,
|
|
27
|
+
): IconButtonState => {
|
|
28
|
+
if (props.isDisabled) return "disabled";
|
|
29
|
+
if (isHovered) return "hovered";
|
|
30
|
+
return "default";
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const cursorValue = (state: IconButtonState): CursorValue => {
|
|
34
|
+
if (state === "disabled") return "not-allowed" as CursorValue;
|
|
35
|
+
return "pointer";
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export function IconButton(props: IconButtonProps) {
|
|
39
|
+
const {
|
|
40
|
+
render: IconComponent,
|
|
41
|
+
variant = "default",
|
|
42
|
+
isDisabled,
|
|
43
|
+
size,
|
|
44
|
+
color,
|
|
45
|
+
strokeWidth,
|
|
46
|
+
style,
|
|
47
|
+
...rest
|
|
48
|
+
} = props;
|
|
49
|
+
|
|
50
|
+
const variantStyles = IconButtonVariants[variant]();
|
|
51
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
52
|
+
const state = calculateState(props, isHovered);
|
|
53
|
+
|
|
54
|
+
const handlePress: PressableProps["onPress"] = (event) => {
|
|
55
|
+
if (isDisabled) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
rest.onPress?.(event);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const iconProps: SvgProps = {
|
|
63
|
+
size: size ?? variantStyles.icon?.default?.size,
|
|
64
|
+
color: color ?? variantStyles.icon?.[state]?.color ?? variantStyles.icon?.default?.color,
|
|
65
|
+
strokeWidth,
|
|
66
|
+
absoluteStrokeWidth: true,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Pressable
|
|
71
|
+
{...rest}
|
|
72
|
+
onPress={handlePress}
|
|
73
|
+
onHoverIn={(e) => {
|
|
74
|
+
setIsHovered(true);
|
|
75
|
+
rest.onHoverIn?.(e);
|
|
76
|
+
}}
|
|
77
|
+
onHoverOut={(e) => {
|
|
78
|
+
setIsHovered(false);
|
|
79
|
+
rest.onHoverOut?.(e);
|
|
80
|
+
}}
|
|
81
|
+
disabled={isDisabled}
|
|
82
|
+
style={[
|
|
83
|
+
variantStyles.root?.default,
|
|
84
|
+
variantStyles.root?.[state],
|
|
85
|
+
{ cursor: cursorValue(state) },
|
|
86
|
+
style,
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<IconComponent {...iconProps} />
|
|
90
|
+
</Pressable>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import type { SvgProps } from "../../types/props.types";
|
|
3
|
+
|
|
4
|
+
export type IconButtonState = "default" | "disabled" | "hovered";
|
|
5
|
+
|
|
6
|
+
export interface IconButtonStyles {
|
|
7
|
+
root?: Partial<Record<IconButtonState, StyleProp<ViewStyle>>>;
|
|
8
|
+
icon?: Partial<Record<IconButtonState, SvgProps>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { IconButtonStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export const useIconButtonVariantDefault = (): IconButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius }): IconButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
padding: 8,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
backgroundColor: colors.primary,
|
|
15
|
+
borderWidth: 1,
|
|
16
|
+
borderColor: colors.border,
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
},
|
|
21
|
+
hovered: {
|
|
22
|
+
backgroundColor: hslaSetRelativeLightness(colors.primary, -10),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
default: {
|
|
27
|
+
color: colors.primaryForeground,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { IconButtonStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export const useIconButtonVariantGhost = (): IconButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius }): IconButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
padding: 8,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
backgroundColor: "transparent",
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
opacity: 0.5,
|
|
18
|
+
},
|
|
19
|
+
hovered: {
|
|
20
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1),
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
icon: {
|
|
24
|
+
default: {
|
|
25
|
+
color: colors.foreground,
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
color: colors.mutedForeground,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useIconButtonVariantDefault } from "./default";
|
|
2
|
+
import { useIconButtonVariantGhost } from "./ghost";
|
|
3
|
+
import { useIconButtonVariantSecondary } from "./secondary";
|
|
4
|
+
|
|
5
|
+
export const IconButtonVariants = {
|
|
6
|
+
default: useIconButtonVariantDefault,
|
|
7
|
+
secondary: useIconButtonVariantSecondary,
|
|
8
|
+
ghost: useIconButtonVariantGhost,
|
|
9
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { IconButtonStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export const useIconButtonVariantSecondary = (): IconButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius }): IconButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
padding: 8,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderColor: colors.border,
|
|
16
|
+
backgroundColor: colors.secondary,
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
},
|
|
21
|
+
hovered: {
|
|
22
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
default: {
|
|
27
|
+
color: colors.secondaryForeground,
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
color: colors.mutedForeground,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./checkbox";
|
|
|
9
9
|
export * from "./empty";
|
|
10
10
|
export * from "./field";
|
|
11
11
|
export * from "./icon";
|
|
12
|
+
export * from "./icon-button";
|
|
12
13
|
export * from "./input";
|
|
13
14
|
export * from "./link";
|
|
14
15
|
export * from "./list";
|
|
@@ -19,6 +20,7 @@ export * from "./portal";
|
|
|
19
20
|
export * from "./progress";
|
|
20
21
|
export * from "./scroll-bar";
|
|
21
22
|
export * from "./select";
|
|
23
|
+
export * from "./separator";
|
|
22
24
|
export * from "./tabs";
|
|
23
25
|
export * from "./textarea";
|
|
24
26
|
export * from "./toast";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { SeparatorVariants } from "./variants";
|
|
4
|
+
|
|
5
|
+
export interface SeparatorProps {
|
|
6
|
+
variant?: keyof typeof SeparatorVariants;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Separator(props: SeparatorProps) {
|
|
11
|
+
const { variant = "horizontal", style } = props;
|
|
12
|
+
const variantStyles = SeparatorVariants[variant]();
|
|
13
|
+
|
|
14
|
+
return <View style={[variantStyles.root, style]} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
2
|
+
import type { SeparatorStyles } from "../types";
|
|
3
|
+
|
|
4
|
+
export const useSeparatorVariantHorizontal = (): SeparatorStyles => {
|
|
5
|
+
return useThemedStyles(
|
|
6
|
+
({ colors }): SeparatorStyles => ({
|
|
7
|
+
root: {
|
|
8
|
+
height: 1,
|
|
9
|
+
alignSelf: "stretch",
|
|
10
|
+
backgroundColor: colors.border,
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
2
|
+
import type { SeparatorStyles } from "../types";
|
|
3
|
+
|
|
4
|
+
export const useSeparatorVariantVertical = (): SeparatorStyles => {
|
|
5
|
+
return useThemedStyles(
|
|
6
|
+
({ colors }): SeparatorStyles => ({
|
|
7
|
+
root: {
|
|
8
|
+
width: 1,
|
|
9
|
+
alignSelf: "stretch",
|
|
10
|
+
backgroundColor: colors.border,
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
);
|
|
14
|
+
};
|