@schandlergarcia/sf-web-components 1.2.18 → 1.3.1
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/library/cards/ListCard.js +15 -15
- package/dist/components/library/cards/TableCard.js +22 -22
- package/dist/components/library/cards/TableCard.js.map +1 -1
- package/dist/components/library/cards/WidgetCard.js +4 -4
- package/dist/components/library/charts/D3Chart.js.map +1 -1
- package/dist/components/library/data/DataModeProvider.js +9 -9
- package/dist/components/library/data/DataModeProvider.js.map +1 -1
- package/dist/components/library/heroui/Collapsible.js +12 -16
- package/dist/components/library/heroui/Collapsible.js.map +1 -1
- package/dist/components/library/heroui/Select.js +6 -8
- package/dist/components/library/heroui/Select.js.map +1 -1
- package/dist/components/library/index.d.ts +4 -27
- package/dist/components/library/index.js +35 -39
- package/dist/components/library/index.js.map +1 -1
- package/dist/components/library/theme/AppThemeProvider.js +4 -4
- package/dist/components/library/theme/AppThemeProvider.js.map +1 -1
- package/dist/components/library/ui/Avatar.js +8 -8
- package/dist/components/library/ui/UIButton.d.ts +22 -11
- package/dist/components/library/ui/UIButton.js +23 -28
- package/dist/components/library/ui/UIButton.js.map +1 -1
- package/dist/components/library/ui/collapsible.d.ts +1 -1
- package/dist/components/library/ui/collapsible.js.map +1 -1
- package/dist/components/library/ui/dialog.d.ts +1 -1
- package/dist/components/library/ui/popover.d.ts +1 -1
- package/dist/components/library/ui/select.d.ts +1 -1
- package/dist/components/library/ui/select.js.map +1 -1
- package/dist/index.js +229 -227
- package/dist/index.js.map +1 -1
- package/package.json +9 -3
- package/src/components/library/index.jsx +5 -7
- package/src/components/library/ui/Collapsible.tsx +1 -1
- package/src/components/library/ui/Dialog.tsx +1 -1
- package/src/components/library/ui/Popover.tsx +1 -1
- package/src/components/library/ui/Select.tsx +1 -1
- package/src/components/library/ui/{UIButton.jsx → UIButton.tsx} +15 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
const VARIANT_CLASSES = {
|
|
4
4
|
primary:
|
|
@@ -10,36 +10,39 @@ const VARIANT_CLASSES = {
|
|
|
10
10
|
outline:
|
|
11
11
|
"bg-transparent text-slate-900 hover:bg-slate-50 dark:text-slate-50 dark:hover:bg-slate-900 border-slate-200 dark:border-slate-800",
|
|
12
12
|
ghost:
|
|
13
|
-
"bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent"
|
|
14
|
-
|
|
13
|
+
"bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent",
|
|
14
|
+
link: "text-brand-600 underline-offset-4 hover:underline dark:text-brand-400 border-transparent"
|
|
15
|
+
} as const;
|
|
15
16
|
|
|
16
17
|
const SIZE_CLASSES = {
|
|
17
18
|
sm: "h-8 px-3 text-sm",
|
|
18
19
|
md: "h-10 px-4 text-sm",
|
|
19
20
|
lg: "h-12 px-5 text-base",
|
|
20
21
|
icon: "h-10 w-10 p-0"
|
|
21
|
-
};
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export interface UIButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
25
|
+
variant?: keyof typeof VARIANT_CLASSES;
|
|
26
|
+
size?: keyof typeof SIZE_CLASSES;
|
|
27
|
+
fullWidth?: boolean;
|
|
28
|
+
}
|
|
22
29
|
|
|
23
30
|
export default function UIButton({
|
|
24
31
|
variant = "primary",
|
|
25
32
|
size = "md",
|
|
26
33
|
fullWidth = false,
|
|
27
34
|
disabled = false,
|
|
28
|
-
onClick = () => {},
|
|
29
|
-
children,
|
|
30
|
-
style = undefined,
|
|
31
35
|
className = "",
|
|
36
|
+
children,
|
|
32
37
|
...rest
|
|
33
|
-
}) {
|
|
34
|
-
const variantClass = VARIANT_CLASSES[variant]
|
|
35
|
-
const sizeClass = SIZE_CLASSES[size]
|
|
38
|
+
}: UIButtonProps) {
|
|
39
|
+
const variantClass = VARIANT_CLASSES[variant];
|
|
40
|
+
const sizeClass = SIZE_CLASSES[size];
|
|
36
41
|
|
|
37
42
|
return (
|
|
38
43
|
<button
|
|
39
44
|
type="button"
|
|
40
|
-
onClick={onClick}
|
|
41
45
|
disabled={disabled}
|
|
42
|
-
style={style}
|
|
43
46
|
className={[
|
|
44
47
|
"inline-flex items-center justify-center gap-2 rounded-lg border font-medium shadow-sm transition",
|
|
45
48
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950",
|
|
@@ -57,5 +60,3 @@ export default function UIButton({
|
|
|
57
60
|
</button>
|
|
58
61
|
);
|
|
59
62
|
}
|
|
60
|
-
|
|
61
|
-
|