@stackframe/stack 2.1.2 → 2.2.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/dist/components/avatar.d.ts +1 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +1 -0
- package/dist/components/card-frame.d.ts +0 -1
- package/dist/components/card-frame.d.ts.map +1 -1
- package/dist/components/credential-sign-in.d.ts +0 -1
- package/dist/components/credential-sign-in.d.ts.map +1 -1
- package/dist/components/credential-sign-in.js +8 -20
- package/dist/components/credential-sign-up.d.ts +0 -1
- package/dist/components/credential-sign-up.d.ts.map +1 -1
- package/dist/components/credential-sign-up.js +13 -20
- package/dist/components/dashboard-frame.d.ts +23 -0
- package/dist/components/dashboard-frame.d.ts.map +1 -0
- package/dist/components/dashboard-frame.js +20 -0
- package/dist/components/divider-with-text.d.ts +1 -1
- package/dist/components/divider-with-text.d.ts.map +1 -1
- package/dist/components/divider-with-text.js +3 -3
- package/dist/components/forgot-password.d.ts +0 -1
- package/dist/components/forgot-password.d.ts.map +1 -1
- package/dist/components/forgot-password.js +1 -5
- package/dist/components/form-warning.d.ts +0 -1
- package/dist/components/logo.d.ts +7 -0
- package/dist/components/logo.d.ts.map +1 -0
- package/dist/components/logo.js +7 -0
- package/dist/components/message-card.d.ts +0 -1
- package/dist/components/oauth-button.d.ts +0 -1
- package/dist/components/oauth-button.d.ts.map +1 -1
- package/dist/components/oauth-button.js +1 -2
- package/dist/components/oauth-group.d.ts +0 -1
- package/dist/components/password-field.d.ts +0 -1
- package/dist/components/password-field.d.ts.map +1 -1
- package/dist/components/password-field.js +3 -2
- package/dist/components/password-reset-inner.d.ts +0 -1
- package/dist/components/password-reset-inner.d.ts.map +1 -1
- package/dist/components/password-reset-inner.js +4 -5
- package/dist/components/redirect-message-card.d.ts +0 -1
- package/dist/components/redirect-message-card.d.ts.map +1 -1
- package/dist/components/redirect-message-card.js +8 -1
- package/dist/components/separator-with-text.d.ts +3 -0
- package/dist/components/separator-with-text.d.ts.map +1 -0
- package/dist/components/separator-with-text.js +6 -0
- package/dist/components/user-avatar.d.ts +3 -0
- package/dist/components/user-avatar.d.ts.map +1 -0
- package/dist/components/user-avatar.js +9 -0
- package/dist/components/user-button.d.ts +4 -0
- package/dist/components/user-button.d.ts.map +1 -0
- package/dist/components/user-button.js +25 -0
- package/dist/components-core/avatar.d.ts +6 -0
- package/dist/components-core/avatar.d.ts.map +1 -0
- package/dist/components-core/avatar.js +38 -0
- package/dist/components-core/button.d.ts +4 -4
- package/dist/components-core/button.d.ts.map +1 -1
- package/dist/components-core/button.js +51 -31
- package/dist/components-core/card.d.ts +5 -4
- package/dist/components-core/card.d.ts.map +1 -1
- package/dist/components-core/card.js +28 -9
- package/dist/components-core/collapsble.d.ts +5 -0
- package/dist/components-core/collapsble.d.ts.map +1 -0
- package/dist/components-core/collapsble.js +6 -0
- package/dist/components-core/collapsible.d.ts +6 -0
- package/dist/components-core/collapsible.d.ts.map +1 -0
- package/dist/components-core/collapsible.js +6 -0
- package/dist/components-core/container.d.ts +3 -3
- package/dist/components-core/container.d.ts.map +1 -1
- package/dist/components-core/container.js +1 -1
- package/dist/components-core/divider.d.ts +2 -3
- package/dist/components-core/divider.d.ts.map +1 -1
- package/dist/components-core/divider.js +5 -5
- package/dist/components-core/dropdown.d.ts +13 -0
- package/dist/components-core/dropdown.d.ts.map +1 -0
- package/dist/components-core/dropdown.js +73 -0
- package/dist/components-core/index.d.ts +41 -19
- package/dist/components-core/index.d.ts.map +1 -1
- package/dist/components-core/index.js +80 -4
- package/dist/components-core/input.d.ts +2 -3
- package/dist/components-core/input.d.ts.map +1 -1
- package/dist/components-core/input.js +1 -1
- package/dist/components-core/label.d.ts +1 -3
- package/dist/components-core/label.d.ts.map +1 -1
- package/dist/components-core/label.js +1 -1
- package/dist/components-core/link.d.ts +3 -3
- package/dist/components-core/link.d.ts.map +1 -1
- package/dist/components-core/link.js +3 -3
- package/dist/components-core/loading-indicator.d.ts +6 -0
- package/dist/components-core/loading-indicator.d.ts.map +1 -0
- package/dist/components-core/loading-indicator.js +18 -0
- package/dist/components-core/popover.d.ts +6 -0
- package/dist/components-core/popover.d.ts.map +1 -0
- package/dist/components-core/popover.js +24 -0
- package/dist/components-core/separator.d.ts +4 -0
- package/dist/components-core/separator.d.ts.map +1 -0
- package/dist/components-core/separator.js +20 -0
- package/dist/components-core/text.d.ts +2 -3
- package/dist/components-core/text.d.ts.map +1 -1
- package/dist/components-core/text.js +3 -3
- package/dist/components-core-joy/button.d.ts +2 -3
- package/dist/components-core-joy/button.d.ts.map +1 -1
- package/dist/components-core-joy/button.js +7 -4
- package/dist/components-core-joy/divider.d.ts +2 -2
- package/dist/components-core-joy/divider.d.ts.map +1 -1
- package/dist/components-core-joy/divider.js +5 -5
- package/dist/components-core-joy/input.d.ts +2 -3
- package/dist/components-core-joy/input.d.ts.map +1 -1
- package/dist/components-core-joy/input.js +3 -3
- package/dist/components-core-joy/separator.d.ts +2 -0
- package/dist/components-core-joy/separator.d.ts.map +1 -0
- package/dist/components-core-joy/separator.js +7 -0
- package/dist/components-core-joy/text.d.ts +6 -3
- package/dist/components-core-joy/text.d.ts.map +1 -1
- package/dist/components-core-joy/text.js +4 -3
- package/dist/components-page/account-settings.d.ts +3 -0
- package/dist/components-page/account-settings.d.ts.map +1 -0
- package/dist/components-page/account-settings.js +95 -0
- package/dist/components-page/email-verification.d.ts +1 -2
- package/dist/components-page/email-verification.d.ts.map +1 -1
- package/dist/components-page/email-verification.js +14 -14
- package/dist/components-page/forgot-password.d.ts +0 -1
- package/dist/components-page/oauth-callback.d.ts +0 -1
- package/dist/components-page/password-reset.d.ts +0 -1
- package/dist/components-page/password-reset.d.ts.map +1 -1
- package/dist/components-page/password-reset.js +14 -15
- package/dist/components-page/sign-in.d.ts +0 -1
- package/dist/components-page/sign-in.js +3 -3
- package/dist/components-page/sign-out.d.ts +0 -1
- package/dist/components-page/sign-up.d.ts +0 -1
- package/dist/components-page/sign-up.js +3 -3
- package/dist/components-page/stack-handler.d.ts +0 -1
- package/dist/components-page/stack-handler.d.ts.map +1 -1
- package/dist/components-page/stack-handler.js +5 -0
- package/dist/icons/logo.d.ts +3 -0
- package/dist/icons/logo.d.ts.map +1 -0
- package/dist/icons/logo.js +7 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/lib/auth.d.ts +1 -2
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +8 -7
- package/dist/lib/cookie.d.ts +0 -1
- package/dist/lib/hooks.d.ts +0 -1
- package/dist/lib/stack-app.d.ts +17 -10
- package/dist/lib/stack-app.d.ts.map +1 -1
- package/dist/lib/stack-app.js +97 -35
- package/dist/providers/component-provider.d.ts +74 -20
- package/dist/providers/component-provider.d.ts.map +1 -1
- package/dist/providers/component-provider.js +41 -18
- package/dist/providers/design-provider.d.ts +0 -1
- package/dist/providers/joy-provider.d.ts +8 -11
- package/dist/providers/joy-provider.d.ts.map +1 -1
- package/dist/providers/joy-provider.js +6 -8
- package/dist/providers/stack-provider-client.d.ts +0 -1
- package/dist/providers/stack-provider.d.ts +0 -1
- package/dist/providers/styled-components-registry.d.ts +0 -1
- package/dist/providers/theme-provider.d.ts +0 -1
- package/dist/utils/constants.d.ts +8 -1
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +2 -0
- package/dist/utils/email.d.ts +0 -1
- package/dist/utils/next.d.ts +0 -1
- package/dist/utils/url.d.ts +0 -1
- package/package.json +11 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type ButtonProps = {
|
|
3
|
-
variant?: 'primary' | 'secondary' | 'warning';
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'warning' | "link";
|
|
4
4
|
color?: string;
|
|
5
5
|
size?: 'sm' | 'md' | 'lg';
|
|
6
6
|
loading?: boolean;
|
|
7
|
-
|
|
7
|
+
onClick?: (() => void) | (() => Promise<void>);
|
|
8
|
+
} & Omit<React.HTMLProps<HTMLButtonElement>, 'size' | 'type' | 'onClick'>;
|
|
8
9
|
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
export
|
|
10
|
-
//# sourceMappingURL=button.d.ts.map
|
|
10
|
+
export { Button, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components-core/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components-core/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4F1B,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CAChD,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;AAkDzE,QAAA,MAAM,MAAM,oGAoCX,CAAC;AAIF,OAAO,EACL,MAAM,GACP,CAAC"}
|
|
@@ -1,30 +1,61 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { useDesign } from "../providers/design-provider";
|
|
5
5
|
import Color from 'color';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import { BORDER_RADIUS, FONT_FAMILY, FONT_SIZES } from "../utils/constants";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { BORDER_RADIUS, FONT_FAMILY, FONT_SIZES, LINK_COLORS } from "../utils/constants";
|
|
8
|
+
import LoadingIndicator from "./loading-indicator";
|
|
9
|
+
function getColors({ propsColor, colors, variant, colorMode, }) {
|
|
10
|
+
let bgColor;
|
|
11
|
+
switch (variant) {
|
|
12
|
+
case 'primary': {
|
|
13
|
+
bgColor = colors.primaryColor;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
case 'secondary': {
|
|
17
|
+
bgColor = colors.secondaryColor;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case 'warning': {
|
|
21
|
+
bgColor = '#ff4500';
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
case 'link': {
|
|
25
|
+
bgColor = 'transparent';
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (propsColor) {
|
|
30
|
+
bgColor = propsColor;
|
|
31
|
+
}
|
|
32
|
+
const c = Color(bgColor);
|
|
33
|
+
const pc = Color(colors.primaryColor);
|
|
11
34
|
const changeColor = (value) => {
|
|
12
35
|
return c.hsl(c.hue(), c.saturationl(), c.lightness() + value).toString();
|
|
13
36
|
};
|
|
14
37
|
const getAlpha = (alpha) => {
|
|
15
38
|
return Color(pc.isDark() ? 'white' : 'black').alpha(alpha).toString();
|
|
16
39
|
};
|
|
40
|
+
if (variant === 'link') {
|
|
41
|
+
return {
|
|
42
|
+
bgColor: 'transparent',
|
|
43
|
+
hoverBgColor: getAlpha(0.1),
|
|
44
|
+
activeBgColor: getAlpha(0.2),
|
|
45
|
+
textColor: LINK_COLORS[colorMode],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
17
48
|
if (c.alpha() === 0) {
|
|
18
49
|
return {
|
|
19
50
|
bgColor: 'transparent',
|
|
20
51
|
hoverBgColor: getAlpha(0.1),
|
|
21
52
|
activeBgColor: getAlpha(0.2),
|
|
22
|
-
textColor:
|
|
53
|
+
textColor: colors.primaryColor,
|
|
23
54
|
};
|
|
24
55
|
}
|
|
25
56
|
else if (c.isLight()) {
|
|
26
57
|
return {
|
|
27
|
-
bgColor
|
|
58
|
+
bgColor,
|
|
28
59
|
hoverBgColor: changeColor(-10),
|
|
29
60
|
activeBgColor: changeColor(-20),
|
|
30
61
|
textColor: 'black',
|
|
@@ -32,7 +63,7 @@ function getColors(color, backgroundColor) {
|
|
|
32
63
|
}
|
|
33
64
|
else {
|
|
34
65
|
return {
|
|
35
|
-
bgColor
|
|
66
|
+
bgColor,
|
|
36
67
|
hoverBgColor: changeColor(10),
|
|
37
68
|
activeBgColor: changeColor(20),
|
|
38
69
|
textColor: 'white',
|
|
@@ -87,29 +118,18 @@ const StyledButton = styled.button `
|
|
|
87
118
|
opacity: 0.5;
|
|
88
119
|
}
|
|
89
120
|
font-family: ${FONT_FAMILY};
|
|
121
|
+
text-decoration: ${props => props.$underline ? 'underline' : 'none'};
|
|
122
|
+
position: relative;
|
|
90
123
|
`;
|
|
91
|
-
const Button = React.forwardRef(({ variant = 'primary', size = 'md', loading = false,
|
|
92
|
-
const { colors } = useDesign();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
bgColor = colors.secondaryColor;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
case 'warning': {
|
|
104
|
-
bgColor = '#ff4500';
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (props.color) {
|
|
109
|
-
bgColor = props.color;
|
|
110
|
-
}
|
|
111
|
-
const buttonColors = getColors(bgColor, colors.backgroundColor);
|
|
112
|
-
return (_jsx(StyledButton, { ref: ref, "$size": size, "$bgColor": buttonColors.bgColor, "$hoverBgColor": buttonColors.hoverBgColor, "$activeBgColor": buttonColors.activeBgColor, "$textColor": buttonColors.textColor, disabled: disabled || loading, ...props, children: props.children }));
|
|
124
|
+
const Button = React.forwardRef(({ variant = 'primary', size = 'md', loading = false, ...props }, ref) => {
|
|
125
|
+
const { colors, colorMode } = useDesign();
|
|
126
|
+
const buttonColors = getColors({
|
|
127
|
+
propsColor: props.color,
|
|
128
|
+
colors,
|
|
129
|
+
variant,
|
|
130
|
+
colorMode,
|
|
131
|
+
});
|
|
132
|
+
return (_jsxs(StyledButton, { ref: ref, "$size": size, "$bgColor": buttonColors.bgColor, "$hoverBgColor": buttonColors.hoverBgColor, "$activeBgColor": buttonColors.activeBgColor, "$textColor": buttonColors.textColor, "$underline": variant === 'link', "$loading": loading, ...props, children: [_jsx("div", { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', visibility: loading ? 'visible' : 'hidden' }, children: _jsx(LoadingIndicator, { color: buttonColors.textColor }) }), _jsx("div", { style: { visibility: loading ? 'hidden' : 'visible' }, children: props.children })] }));
|
|
113
133
|
});
|
|
114
134
|
Button.displayName = 'Button';
|
|
115
|
-
export
|
|
135
|
+
export { Button, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Card, CardHeader, CardFooter, CardContent, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components-core/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components-core/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,IAAI,6GAGR,CAAC;AAGH,QAAA,MAAM,UAAU,6GAEd,CAAC;AAGH,QAAA,MAAM,WAAW,6GAEf,CAAC;AAGH,QAAA,MAAM,UAAU,6GAEd,CAAC;AA8BH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,GACZ,CAAC"}
|
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { useDesign } from "..";
|
|
6
|
+
const Card = React.forwardRef((props, ref) => {
|
|
7
|
+
const { colors } = useDesign();
|
|
8
|
+
return _jsx(StyledCard, { ref: ref, ...props, backgroundColor: colors.backgroundColor, borderColor: colors.neutralColor });
|
|
9
|
+
});
|
|
10
|
+
Card.displayName = "Card";
|
|
11
|
+
const CardHeader = React.forwardRef((props, ref) => (_jsx(StyledCardHeader, { ref: ref, ...props })));
|
|
12
|
+
CardHeader.displayName = "CardHeader";
|
|
13
|
+
const CardContent = React.forwardRef((props, ref) => (_jsx(StyledCardContent, { ref: ref, ...props })));
|
|
14
|
+
CardContent.displayName = "CardContent";
|
|
15
|
+
const CardFooter = React.forwardRef((props, ref) => (_jsx(StyledCardFooter, { ref: ref, ...props })));
|
|
16
|
+
CardFooter.displayName = "CardFooter";
|
|
6
17
|
const StyledCard = styled.div `
|
|
7
|
-
border-radius: 0.
|
|
18
|
+
border-radius: 0.5rem;
|
|
8
19
|
border: 1px solid ${props => props.borderColor};
|
|
9
20
|
background-color: ${props => props.backgroundColor};
|
|
10
21
|
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
|
|
11
22
|
padding: 1.5rem;
|
|
12
23
|
`;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
const StyledCardHeader = styled.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: 0.375rem;
|
|
28
|
+
margin-bottom: 1.5rem;
|
|
29
|
+
`;
|
|
30
|
+
const StyledCardContent = styled.div `
|
|
31
|
+
`;
|
|
32
|
+
const StyledCardFooter = styled.div `
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
margin-top: 1.5rem;
|
|
36
|
+
`;
|
|
37
|
+
export { Card, CardHeader, CardFooter, CardContent, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsble.d.ts","sourceRoot":"","sources":["../../src/components-core/collapsble.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW,KAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,KAA0C,CAAC;AAEnE,QAAA,MAAM,kBAAkB,KAA0C,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
4
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
5
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
6
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
|
+
declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/components-core/collapsible.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAEpE,QAAA,MAAM,WAAW,kIAA4B,CAAC;AAC9C,QAAA,MAAM,kBAAkB,4IAA0C,CAAC;AACnE,QAAA,MAAM,kBAAkB,yIAA0C,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
4
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
5
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
6
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
type ContainerProps = {
|
|
3
3
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
4
4
|
} & Omit<React.HTMLProps<HTMLDivElement>, 'size'>;
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export declare function Container({ size, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/components-core/container.tsx"],"names":[],"mappings":";AAKA,
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/components-core/container.tsx"],"names":[],"mappings":";AAKA,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CAClD,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAA;AAejD,wBAAgB,SAAS,CAAC,EACxB,IAAS,EACT,GAAG,KAAK,EACT,EAAG,cAAc,2CAYjB"}
|
|
@@ -13,7 +13,7 @@ const InnerContainer = styled.div `
|
|
|
13
13
|
width: ${props => props.$breakpoint}px;
|
|
14
14
|
}
|
|
15
15
|
`;
|
|
16
|
-
export
|
|
16
|
+
export function Container({ size = 'md', ...props }) {
|
|
17
17
|
const { breakpoints } = useDesign();
|
|
18
18
|
return (_jsx(OuterContainer, { children: _jsx(InnerContainer, { "$breakpoint": typeof size === 'number' ? size : breakpoints[size], ...props, children: props.children }) }));
|
|
19
19
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default Divider;
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
|
6
5
|
//# sourceMappingURL=divider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/components-core/divider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/components-core/divider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAiBhE,QAAA,MAAM,SAAS,6JAab,CAAC;AAIH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { useDesign } from '..';
|
|
7
|
-
const
|
|
7
|
+
const StyledSeparator = styled(SeparatorPrimitive.Root) `
|
|
8
8
|
flex-shrink: 0;
|
|
9
9
|
background-color: ${props => props.$color};
|
|
10
10
|
|
|
@@ -12,9 +12,9 @@ const StyledDivider = styled(SeparatorPrimitive.Root) `
|
|
|
12
12
|
? 'height: 1px; width: 100%;'
|
|
13
13
|
: 'height: 100%; width: 1px;'}
|
|
14
14
|
`;
|
|
15
|
-
const
|
|
15
|
+
const Separator = React.forwardRef(({ orientation = 'horizontal', decorative = true, ...props }, ref) => {
|
|
16
16
|
const { colors } = useDesign();
|
|
17
|
-
return _jsx(
|
|
17
|
+
return _jsx(StyledSeparator, { ref: ref, decorative: decorative, "$orientation": orientation, "$color": colors.neutralColor, ...props });
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
export
|
|
19
|
+
Separator.displayName = 'Separator';
|
|
20
|
+
export { Separator };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
7
|
+
inset?: boolean | undefined;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/components-core/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAIvE,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAUhD,QAAA,MAAM,mBAAmB,gLAKvB,CAAC;AAgBH,QAAA,MAAM,mBAAmB,0KAgBvB,CAAC;AAyBH,QAAA,MAAM,gBAAgB;;wCAQpB,CAAC;AAUH,QAAA,MAAM,iBAAiB;;wCAOrB,CAAC;AAWH,QAAA,MAAM,qBAAqB,4KAMzB,CAAC;AAGH,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
6
|
+
import { useDesign } from '..';
|
|
7
|
+
import { SELECTED_BACKGROUND_COLORS } from '../utils/constants';
|
|
8
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
9
|
+
const StyledTrigger = styled(DropdownMenuPrimitive.Trigger) `
|
|
10
|
+
all: unset;
|
|
11
|
+
&:focus {
|
|
12
|
+
outline: none;
|
|
13
|
+
box-shadow: 0;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const DropdownMenuTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(StyledTrigger, { ref: ref, ...props })));
|
|
17
|
+
const StyledContent = styled(DropdownMenuPrimitive.Content) `
|
|
18
|
+
z-index: 50;
|
|
19
|
+
min-width: 8rem;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
border: 1px solid ${({ $neutralColor }) => $neutralColor};
|
|
23
|
+
background: ${({ $backgroundColor }) => $backgroundColor};
|
|
24
|
+
padding: 0.25rem;
|
|
25
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
26
|
+
`;
|
|
27
|
+
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
28
|
+
const { colors } = useDesign();
|
|
29
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(StyledContent, { "$backgroundColor": colors.backgroundColor, "$neutralColor": colors.neutralColor, sideOffset: sideOffset, ref: ref, ...props }) }));
|
|
30
|
+
});
|
|
31
|
+
DropdownMenuContent.displayName = 'DropdownMenuContent';
|
|
32
|
+
const StyledItem = styled(DropdownMenuPrimitive.Item) `
|
|
33
|
+
display: flex;
|
|
34
|
+
cursor: default;
|
|
35
|
+
align-items: center;
|
|
36
|
+
border-radius: 4px;
|
|
37
|
+
padding: 0.375rem 0.5rem;
|
|
38
|
+
font-size: 0.875rem;
|
|
39
|
+
outline: none;
|
|
40
|
+
transition: color 0.2s ease;
|
|
41
|
+
&:focus {
|
|
42
|
+
background-color: var(--accent);
|
|
43
|
+
color: var(--accent-foreground);
|
|
44
|
+
}
|
|
45
|
+
&:hover {
|
|
46
|
+
background-color: ${({ $colorMode }) => SELECTED_BACKGROUND_COLORS[$colorMode]};
|
|
47
|
+
}
|
|
48
|
+
${({ $inset }) => $inset && 'padding-left: 2rem;'}
|
|
49
|
+
`;
|
|
50
|
+
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => {
|
|
51
|
+
const { colorMode } = useDesign();
|
|
52
|
+
return _jsx(StyledItem, { ref: ref, ...props, "$inset": inset, "$colorMode": colorMode });
|
|
53
|
+
});
|
|
54
|
+
DropdownMenuItem.displayName = 'DropdownMenuItem';
|
|
55
|
+
const StyledLabel = styled(DropdownMenuPrimitive.Label) `
|
|
56
|
+
padding: 0.375rem 0.5rem;
|
|
57
|
+
font-size: 0.875rem;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
${({ inset }) => inset && 'padding-left: 2rem;'}
|
|
60
|
+
`;
|
|
61
|
+
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(StyledLabel, { ref: ref, ...props, inset: inset })));
|
|
62
|
+
DropdownMenuLabel.displayName = 'DropdownMenuLabel';
|
|
63
|
+
const StyledSeparator = styled(DropdownMenuPrimitive.Separator) `
|
|
64
|
+
margin: 0.25rem -0.25rem;
|
|
65
|
+
height: 1px;
|
|
66
|
+
background-color: ${({ $color }) => $color};
|
|
67
|
+
`;
|
|
68
|
+
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
69
|
+
const { colors } = useDesign();
|
|
70
|
+
return _jsx(StyledSeparator, { ref: ref, ...props, "$color": colors.neutralColor });
|
|
71
|
+
});
|
|
72
|
+
DropdownMenuSeparator.displayName = 'DropdownMenuSeparator';
|
|
73
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, };
|
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Link as StaticLink } from './link';
|
|
3
|
+
import type { Popover as StaticPopover } from './popover';
|
|
4
|
+
import type { DropdownMenu as StaticDropdownMenu } from './dropdown';
|
|
5
|
+
import type { Collapsible as StaticCollapsible } from './collapsible';
|
|
6
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<Omit<import("./button").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const Container: React.ForwardRefExoticComponent<Omit<{
|
|
8
|
+
size?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
9
|
+
} & Omit<React.HTMLProps<HTMLDivElement>, "size">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const Separator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLHRElement>>;
|
|
11
|
+
export declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement> & Pick<React.HTMLProps<HTMLInputElement>, "ref">, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
export declare const Label: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-label").LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
13
|
+
export declare function Link(props: React.ComponentProps<typeof StaticLink>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const Text: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
15
|
+
variant?: "primary" | "secondary" | "warning" | "success" | undefined;
|
|
16
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | undefined;
|
|
17
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
18
|
+
} & Omit<React.HTMLProps<HTMLParagraphElement>, "size">, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export declare const Card: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export declare function Popover(props: React.ComponentProps<typeof StaticPopover>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-popover").PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
export declare const PopoverContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare function DropdownMenu(props: React.ComponentProps<typeof StaticDropdownMenu>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
export declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
27
|
+
inset?: boolean | undefined;
|
|
28
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
30
|
+
inset?: boolean | undefined;
|
|
31
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export declare const Avatar: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-avatar").AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-avatar").AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export declare const AvatarImage: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-avatar").AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
36
|
+
export declare function Collapsible(props: React.ComponentProps<typeof StaticCollapsible>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const CollapsibleTrigger: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-collapsible").CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
export declare const CollapsibleContent: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-collapsible").CollapsibleContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export declare const CardHeader: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export declare const CardContent: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export declare const CardFooter: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components-core/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components-core/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQjD,OAAO,KAAK,EACV,OAAO,IAAI,aAAa,EAGzB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,YAAY,IAAI,kBAAkB,EAMnC,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EACV,WAAW,IAAI,iBAAiB,EAGjC,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,MAAM,6KAgBjB,CAAC;AAEH,eAAO,MAAM,SAAS;;gGAMpB,CAAC;AAEH,eAAO,MAAM,SAAS,gOAMpB,CAAC;AAEH,eAAO,MAAM,KAAK,yOAMhB,CAAC;AAEH,eAAO,MAAM,KAAK,+NAMhB,CAAC;AAEH,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,2CAGlE;AAED,eAAO,MAAM,IAAI;;;;gKAMf,CAAC;AAEH,eAAO,MAAM,IAAI,gKAMf,CAAC;AAEH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,2CAGxE;AAED,eAAO,MAAM,cAAc,uLAMzB,CAAC;AAEH,eAAO,MAAM,cAAc,oOAMzB,CAAC;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,2CAGlF;AAED,eAAO,MAAM,mBAAmB,wPAM9B,CAAC;AAEH,eAAO,MAAM,mBAAmB,+OAM9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;sFAM3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;sFAM5B,CAAC;AAEH,eAAO,MAAM,qBAAqB,iPAMhC,CAAC;AAEH,eAAO,MAAM,MAAM,6NAMjB,CAAC;AAEH,eAAO,MAAM,cAAc,qOAMzB,CAAC;AAEH,eAAO,MAAM,WAAW,sOAMtB,CAAC;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,2CAGhF;AAED,eAAO,MAAM,kBAAkB,+LAM7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,yLAM7B,CAAC;AAEH,eAAO,MAAM,UAAU,gKAMrB,CAAC;AAEH,eAAO,MAAM,WAAW,gKAMtB,CAAC;AAEH,eAAO,MAAM,UAAU,gKAMrB,CAAC"}
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { useComponents } from '../providers/component-provider';
|
|
5
|
+
import { useAsyncCallbackWithLoggedError } from '@stackframe/stack-shared/dist/hooks/use-async-callback';
|
|
5
6
|
export const Button = forwardRef((props, ref) => {
|
|
6
7
|
const { Button } = useComponents();
|
|
7
|
-
|
|
8
|
+
const [onClick, onClickLoading] = useAsyncCallbackWithLoggedError(async () => {
|
|
9
|
+
return await props.onClick?.();
|
|
10
|
+
}, [props.onClick]);
|
|
11
|
+
return _jsx(Button, { ...props, onClick: props.onClick && onClick, loading: props.loading || onClickLoading, disabled: props.disabled || onClickLoading, ref: ref });
|
|
8
12
|
});
|
|
9
13
|
export const Container = forwardRef((props, ref) => {
|
|
10
14
|
const { Container } = useComponents();
|
|
11
15
|
return _jsx(Container, { ...props, ref: ref });
|
|
12
16
|
});
|
|
13
|
-
export const
|
|
14
|
-
const {
|
|
15
|
-
return _jsx(
|
|
17
|
+
export const Separator = forwardRef((props, ref) => {
|
|
18
|
+
const { Separator } = useComponents();
|
|
19
|
+
return _jsx(Separator, { ...props, ref: ref });
|
|
16
20
|
});
|
|
17
21
|
export const Input = forwardRef((props, ref) => {
|
|
18
22
|
const { Input } = useComponents();
|
|
@@ -34,3 +38,75 @@ export const Card = forwardRef((props, ref) => {
|
|
|
34
38
|
const { Card } = useComponents();
|
|
35
39
|
return _jsx(Card, { ...props, ref: ref });
|
|
36
40
|
});
|
|
41
|
+
export function Popover(props) {
|
|
42
|
+
const { Popover } = useComponents();
|
|
43
|
+
return _jsx(Popover, { ...props });
|
|
44
|
+
}
|
|
45
|
+
export const PopoverTrigger = forwardRef((props, ref) => {
|
|
46
|
+
const { PopoverTrigger } = useComponents();
|
|
47
|
+
return _jsx(PopoverTrigger, { ...props, ref: ref });
|
|
48
|
+
});
|
|
49
|
+
export const PopoverContent = forwardRef((props, ref) => {
|
|
50
|
+
const { PopoverContent } = useComponents();
|
|
51
|
+
return _jsx(PopoverContent, { ...props, ref: ref });
|
|
52
|
+
});
|
|
53
|
+
export function DropdownMenu(props) {
|
|
54
|
+
const { DropdownMenu } = useComponents();
|
|
55
|
+
return _jsx(DropdownMenu, { ...props });
|
|
56
|
+
}
|
|
57
|
+
export const DropdownMenuTrigger = forwardRef((props, ref) => {
|
|
58
|
+
const { DropdownMenuTrigger } = useComponents();
|
|
59
|
+
return _jsx(DropdownMenuTrigger, { ...props, ref: ref });
|
|
60
|
+
});
|
|
61
|
+
export const DropdownMenuContent = forwardRef((props, ref) => {
|
|
62
|
+
const { DropdownMenuContent } = useComponents();
|
|
63
|
+
return _jsx(DropdownMenuContent, { ...props, ref: ref });
|
|
64
|
+
});
|
|
65
|
+
export const DropdownMenuItem = forwardRef((props, ref) => {
|
|
66
|
+
const { DropdownMenuItem } = useComponents();
|
|
67
|
+
return _jsx(DropdownMenuItem, { ...props, ref: ref });
|
|
68
|
+
});
|
|
69
|
+
export const DropdownMenuLabel = forwardRef((props, ref) => {
|
|
70
|
+
const { DropdownMenuLabel } = useComponents();
|
|
71
|
+
return _jsx(DropdownMenuLabel, { ...props, ref: ref });
|
|
72
|
+
});
|
|
73
|
+
export const DropdownMenuSeparator = forwardRef((props, ref) => {
|
|
74
|
+
const { DropdownMenuSeparator } = useComponents();
|
|
75
|
+
return _jsx(DropdownMenuSeparator, { ...props, ref: ref });
|
|
76
|
+
});
|
|
77
|
+
export const Avatar = forwardRef((props, ref) => {
|
|
78
|
+
const { Avatar } = useComponents();
|
|
79
|
+
return _jsx(Avatar, { ...props, ref: ref });
|
|
80
|
+
});
|
|
81
|
+
export const AvatarFallback = forwardRef((props, ref) => {
|
|
82
|
+
const { AvatarFallback } = useComponents();
|
|
83
|
+
return _jsx(AvatarFallback, { ...props, ref: ref });
|
|
84
|
+
});
|
|
85
|
+
export const AvatarImage = forwardRef((props, ref) => {
|
|
86
|
+
const { AvatarImage } = useComponents();
|
|
87
|
+
return _jsx(AvatarImage, { ...props, ref: ref });
|
|
88
|
+
});
|
|
89
|
+
export function Collapsible(props) {
|
|
90
|
+
const { Collapsible } = useComponents();
|
|
91
|
+
return _jsx(Collapsible, { ...props });
|
|
92
|
+
}
|
|
93
|
+
export const CollapsibleTrigger = forwardRef((props, ref) => {
|
|
94
|
+
const { CollapsibleTrigger } = useComponents();
|
|
95
|
+
return _jsx(CollapsibleTrigger, { ...props, ref: ref });
|
|
96
|
+
});
|
|
97
|
+
export const CollapsibleContent = forwardRef((props, ref) => {
|
|
98
|
+
const { CollapsibleContent } = useComponents();
|
|
99
|
+
return _jsx(CollapsibleContent, { ...props, ref: ref });
|
|
100
|
+
});
|
|
101
|
+
export const CardHeader = forwardRef((props, ref) => {
|
|
102
|
+
const { CardHeader } = useComponents();
|
|
103
|
+
return _jsx(CardHeader, { ...props, ref: ref });
|
|
104
|
+
});
|
|
105
|
+
export const CardContent = forwardRef((props, ref) => {
|
|
106
|
+
const { CardContent } = useComponents();
|
|
107
|
+
return _jsx(CardContent, { ...props, ref: ref });
|
|
108
|
+
});
|
|
109
|
+
export const CardFooter = forwardRef((props, ref) => {
|
|
110
|
+
const { CardFooter } = useComponents();
|
|
111
|
+
return _jsx(CardFooter, { ...props, ref: ref });
|
|
112
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
type InputProps = React.InputHTMLAttributes<HTMLInputElement> & Pick<React.HTMLProps<HTMLInputElement>, 'ref'>;
|
|
3
3
|
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
4
|
-
export
|
|
5
|
-
//# sourceMappingURL=input.d.ts.map
|
|
4
|
+
export { Input };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components-core/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components-core/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,UAAU,GAAG,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAA;AA2C9G,QAAA,MAAM,KAAK,kGAgBV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -42,4 +42,4 @@ const Input = React.forwardRef((props, ref) => {
|
|
|
42
42
|
return (_jsx(StyledInput, { ref: ref, "$borderColor": colors.neutralColor, "$placeholderColor": SECONDARY_FONT_COLORS[colorMode], "$textColor": PRIMARY_FONT_COLORS[colorMode], "$fileSelectorColor": SECONDARY_FONT_COLORS[colorMode], "$fileSelectorButtonColor": PRIMARY_FONT_COLORS[colorMode], "$focusShadowColor": colors.primaryColor, ...props }));
|
|
43
43
|
});
|
|
44
44
|
Input.displayName = 'Input';
|
|
45
|
-
export
|
|
45
|
+
export { Input };
|