ag-common 0.0.771 → 0.0.772
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/ui/components/Confirm/Modal.js +3 -3
- package/dist/ui/components/Prompt/Modal.js +3 -3
- package/dist/ui/components/shadcn/button.d.ts +2 -4
- package/dist/ui/components/shadcn/button.js +4 -7
- package/package.json +1 -1
- package/dist/ui/components/Button/index.d.ts +0 -14
- package/dist/ui/components/Button/index.js +0 -68
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.ConfirmModal = void 0;
|
|
8
8
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const Button_1 = require("../Button");
|
|
11
10
|
const FlexColumn_1 = require("../FlexColumn");
|
|
12
11
|
const FlexRow_1 = require("../FlexRow");
|
|
13
12
|
const Modal_1 = require("../Modal/Modal");
|
|
13
|
+
const button_1 = require("../shadcn/button");
|
|
14
14
|
const Base = styled_1.default.div `
|
|
15
15
|
width: 95vw;
|
|
16
16
|
max-width: 30rem;
|
|
@@ -47,7 +47,7 @@ const ConfirmModal = ({ onSubmit, bottomText, topText, okText = 'OK', cancelText
|
|
|
47
47
|
topText && react_1.default.createElement(TopText, null, topText),
|
|
48
48
|
react_1.default.createElement(BottomText, null, bottomText),
|
|
49
49
|
react_1.default.createElement(Bottom, { noGrow: true },
|
|
50
|
-
react_1.default.createElement(
|
|
51
|
-
react_1.default.createElement(
|
|
50
|
+
react_1.default.createElement(button_1.Button, { onClick: () => onSubmit(true) }, okText),
|
|
51
|
+
react_1.default.createElement(button_1.Button, { variant: "outline", onClick: () => onSubmit(false) }, cancelText))))));
|
|
52
52
|
};
|
|
53
53
|
exports.ConfirmModal = ConfirmModal;
|
|
@@ -40,10 +40,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.PromptModal = void 0;
|
|
41
41
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
-
const Button_1 = require("../Button");
|
|
44
43
|
const FlexColumn_1 = require("../FlexColumn");
|
|
45
44
|
const FlexRow_1 = require("../FlexRow");
|
|
46
45
|
const Modal_1 = require("../Modal/Modal");
|
|
46
|
+
const button_1 = require("../shadcn/button");
|
|
47
47
|
const TextEdit_1 = require("../TextEdit");
|
|
48
48
|
const Base = styled_1.default.div `
|
|
49
49
|
width: 95vw;
|
|
@@ -105,7 +105,7 @@ const PromptModal = ({ root, wrapper, res, bottomText, topText, okText = 'OK', c
|
|
|
105
105
|
}
|
|
106
106
|
}, placeholder: placeholder, defaultEditing: { focus: true }, singleLine: true, noGrow: true, allowUndo: false }),
|
|
107
107
|
react_1.default.createElement(Bottom, { noGrow: true },
|
|
108
|
-
react_1.default.createElement(
|
|
109
|
-
react_1.default.createElement(
|
|
108
|
+
react_1.default.createElement(button_1.Button, { onClick: () => ret(text) }, okText),
|
|
109
|
+
react_1.default.createElement(button_1.Button, { variant: "outline", onClick: () => ret(undefined) }, cancelText))))));
|
|
110
110
|
};
|
|
111
111
|
exports.PromptModal = PromptModal;
|
|
@@ -4,8 +4,6 @@ declare const buttonVariants: (props?: ({
|
|
|
4
4
|
variant?: "default" | "link" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>;
|
|
8
|
+
declare const Button: ({ className, variant, size, ...props }: ButtonProps) => React.JSX.Element;
|
|
11
9
|
export { Button, buttonVariants };
|
|
@@ -45,7 +45,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
45
45
|
};
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
exports.buttonVariants = exports.Button = void 0;
|
|
48
|
-
const react_slot_1 = require("@radix-ui/react-slot");
|
|
49
48
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
50
49
|
const React = __importStar(require("react"));
|
|
51
50
|
const utils_1 = require("../../helpers/utils");
|
|
@@ -72,10 +71,8 @@ const buttonVariants = (0, class_variance_authority_1.cva)('!cursor-pointer inli
|
|
|
72
71
|
},
|
|
73
72
|
});
|
|
74
73
|
exports.buttonVariants = buttonVariants;
|
|
75
|
-
const Button =
|
|
76
|
-
var { className, variant, size
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
74
|
+
const Button = (_a) => {
|
|
75
|
+
var { className, variant, size } = _a, props = __rest(_a, ["className", "variant", "size"]);
|
|
76
|
+
return (React.createElement("button", Object.assign({ className: (0, utils_1.cn)(buttonVariants({ variant, size, className })) }, props)));
|
|
77
|
+
};
|
|
80
78
|
exports.Button = Button;
|
|
81
|
-
Button.displayName = 'Button';
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { JSX, KeyboardEventHandler, MouseEventHandler } from 'react';
|
|
2
|
-
export declare const ButtonBase: import("@emotion/react").SerializedStyles;
|
|
3
|
-
export interface IButton {
|
|
4
|
-
title?: string;
|
|
5
|
-
invert?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
-
onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
|
|
10
|
-
children: string | JSX.Element;
|
|
11
|
-
href?: string;
|
|
12
|
-
colourTheme?: 'green' | 'red';
|
|
13
|
-
}
|
|
14
|
-
export declare const Button: (props: IButton) => JSX.Element;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.Button = exports.ButtonBase = void 0;
|
|
8
|
-
const react_1 = require("@emotion/react");
|
|
9
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
10
|
-
const react_2 = __importDefault(require("react"));
|
|
11
|
-
const colours_1 = require("../../styles/colours");
|
|
12
|
-
exports.ButtonBase = (0, react_1.css) `
|
|
13
|
-
text-decoration: none;
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
align-items: center;
|
|
17
|
-
border: 0;
|
|
18
|
-
font-weight: bold;
|
|
19
|
-
font-family: inherit;
|
|
20
|
-
font-size: 1.2rem;
|
|
21
|
-
border-radius: 0.5rem;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
height: 3rem;
|
|
24
|
-
line-height: 1rem;
|
|
25
|
-
&:hover {
|
|
26
|
-
filter: saturate(1.5);
|
|
27
|
-
}
|
|
28
|
-
padding-left: 1rem;
|
|
29
|
-
padding-right: 1rem;
|
|
30
|
-
color: white;
|
|
31
|
-
|
|
32
|
-
&[data-disabled='true'] {
|
|
33
|
-
cursor: default !important;
|
|
34
|
-
background-color: #888 !important;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&[data-theme='green'] {
|
|
38
|
-
background-color: ${colours_1.colours.darkGreen};
|
|
39
|
-
&[data-invert='true'] {
|
|
40
|
-
color: ${colours_1.colours.darkGreen};
|
|
41
|
-
background-color: white;
|
|
42
|
-
border: solid 1px ${colours_1.colours.darkGreen};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&[data-theme='red'] {
|
|
47
|
-
background-color: ${colours_1.colours.orangeRed};
|
|
48
|
-
&[data-invert='true'] {
|
|
49
|
-
color: ${colours_1.colours.orangeRed};
|
|
50
|
-
background-color: white;
|
|
51
|
-
border: solid 1px ${colours_1.colours.orangeRed};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
const BaseButton = styled_1.default.button `
|
|
56
|
-
${exports.ButtonBase}
|
|
57
|
-
`;
|
|
58
|
-
const BaseA = styled_1.default.a `
|
|
59
|
-
${exports.ButtonBase}
|
|
60
|
-
`;
|
|
61
|
-
const Button = (props) => {
|
|
62
|
-
var _a, _b;
|
|
63
|
-
const Component = props.href
|
|
64
|
-
? BaseA
|
|
65
|
-
: BaseButton;
|
|
66
|
-
return (react_2.default.createElement(Component, Object.assign({ className: props.className, "data-invert": props.invert, "data-disabled": (_a = props.disabled) !== null && _a !== void 0 ? _a : false, role: "button", title: props.title || undefined, "data-theme": (_b = props.colourTheme) !== null && _b !== void 0 ? _b : 'green' }, props), props.children));
|
|
67
|
-
};
|
|
68
|
-
exports.Button = Button;
|