@grucloud/bau-ui 0.41.0 → 0.43.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/README.md +4 -2
- package/accordion/accordion.js +32 -62
- package/accordion/index.d.ts +5 -7
- package/alert/alert.js +33 -30
- package/animate/animate.js +48 -34
- package/animate/index.d.ts +2 -3
- package/autocomplete/autocomplete.js +14 -11
- package/avatar/avatar.js +5 -2
- package/badge/index.d.ts +0 -4
- package/bau-ui.d.ts +3 -1
- package/breadcrumbs/breadcrumbs.js +2 -5
- package/button/button.js +59 -52
- package/buttonGroup/buttonGroup.js +4 -3
- package/carousel/carousel.js +105 -0
- package/carousel/index.d.ts +22 -0
- package/carousel/index.js +1 -0
- package/chip/chip.js +11 -11
- package/collapsible/collapsible.js +121 -0
- package/collapsible/index.d.ts +10 -0
- package/collapsible/index.js +1 -0
- package/constants.d.ts +8 -2
- package/constants.js +8 -1
- package/context.d.ts +2 -0
- package/context.js +5 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +22 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/functions/accordion.default.html +100 -0
- package/docs/functions/alert.default.html +97 -0
- package/docs/functions/alertStack.default.html +97 -0
- package/docs/functions/animate.default.html +93 -0
- package/docs/functions/autocomplete.default.html +97 -0
- package/docs/functions/avatar.default.html +97 -0
- package/docs/functions/badge.default.html +97 -0
- package/docs/functions/breadcrumbs.default.html +98 -0
- package/docs/functions/button.default.html +97 -0
- package/docs/functions/buttonGroup.default.html +97 -0
- package/docs/functions/calendar.default.html +97 -0
- package/docs/functions/checkbox.default.html +97 -0
- package/docs/functions/chip.default.html +97 -0
- package/docs/functions/context.createContext.html +92 -0
- package/docs/functions/drawer.default.html +97 -0
- package/docs/functions/drillDownMenu.default.html +100 -0
- package/docs/functions/fileInput.default.html +97 -0
- package/docs/functions/form.default.html +97 -0
- package/docs/functions/globalStyle.default.html +96 -0
- package/docs/functions/input.default.html +97 -0
- package/docs/functions/list.default.html +97 -0
- package/docs/functions/modal.default.html +97 -0
- package/docs/functions/paper.default.html +97 -0
- package/docs/functions/popover.default.html +97 -0
- package/docs/functions/select.default.html +97 -0
- package/docs/functions/slider.default.html +97 -0
- package/docs/functions/spinner.default.html +97 -0
- package/docs/functions/switch.default.html +97 -0
- package/docs/functions/tableContainer.default.html +96 -0
- package/docs/functions/tablePagination.default.html +97 -0
- package/docs/functions/tabs.default.html +101 -0
- package/docs/functions/themeSwitch.default.html +96 -0
- package/docs/functions/tooltip.default.html +97 -0
- package/docs/functions/treeView.default.html +100 -0
- package/docs/index.html +82 -0
- package/docs/modules/accordion.html +104 -0
- package/docs/modules/alert.html +98 -0
- package/docs/modules/alertStack.html +98 -0
- package/docs/modules/animate.html +94 -0
- package/docs/modules/autocomplete.html +98 -0
- package/docs/modules/avatar.html +98 -0
- package/docs/modules/badge.html +98 -0
- package/docs/modules/bau_ui.html +97 -0
- package/docs/modules/breadcrumbs.html +100 -0
- package/docs/modules/button.html +98 -0
- package/docs/modules/buttonGroup.html +98 -0
- package/docs/modules/calendar.html +98 -0
- package/docs/modules/checkbox.html +98 -0
- package/docs/modules/chip.html +98 -0
- package/docs/modules/constants.html +102 -0
- package/docs/modules/context.html +92 -0
- package/docs/modules/drawer.html +98 -0
- package/docs/modules/drillDownMenu.html +104 -0
- package/docs/modules/fileInput.html +98 -0
- package/docs/modules/form.html +98 -0
- package/docs/modules/globalStyle.html +96 -0
- package/docs/modules/input.html +98 -0
- package/docs/modules/list.html +98 -0
- package/docs/modules/modal.html +98 -0
- package/docs/modules/paper.html +98 -0
- package/docs/modules/popover.html +98 -0
- package/docs/modules/select.html +98 -0
- package/docs/modules/slider.html +98 -0
- package/docs/modules/spinner.html +98 -0
- package/docs/modules/switch.html +98 -0
- package/docs/modules/tableContainer.html +96 -0
- package/docs/modules/tablePagination.html +98 -0
- package/docs/modules/tabs.html +106 -0
- package/docs/modules/themeSwitch.html +96 -0
- package/docs/modules/tooltip.html +98 -0
- package/docs/modules/treeView.html +104 -0
- package/docs/types/accordion.Accordion.html +96 -0
- package/docs/types/accordion.AccordionItem.html +89 -0
- package/docs/types/accordion.AccordionItemPropBase.html +94 -0
- package/docs/types/accordion.AccordionProps.html +94 -0
- package/docs/types/accordion.Component.html +89 -0
- package/docs/types/accordion.ComponentOption.html +89 -0
- package/docs/types/accordion.DefaultDesignProps.html +89 -0
- package/docs/types/alert.AnimateProps.html +91 -0
- package/docs/types/alert.Component.html +86 -0
- package/docs/types/alert.ComponentOption.html +86 -0
- package/docs/types/alert.DefaultDesignProps.html +86 -0
- package/docs/types/alertStack.AlertStack.html +86 -0
- package/docs/types/alertStack.AlertStackProps.html +89 -0
- package/docs/types/alertStack.ComponentOption.html +86 -0
- package/docs/types/alertStack.DefaultDesignProps.html +86 -0
- package/docs/types/animate.AnimateProps.html +103 -0
- package/docs/types/animate.Component.html +84 -0
- package/docs/types/autocomplete.Autocomplete.html +125 -0
- package/docs/types/autocomplete.Component.html +86 -0
- package/docs/types/autocomplete.ComponentOption.html +86 -0
- package/docs/types/autocomplete.DefaultDesignProps.html +86 -0
- package/docs/types/avatar.AvatarProps.html +99 -0
- package/docs/types/avatar.Component.html +86 -0
- package/docs/types/avatar.ComponentOption.html +86 -0
- package/docs/types/avatar.DefaultDesignProps.html +86 -0
- package/docs/types/badge.BadgeProps.html +91 -0
- package/docs/types/badge.Component.html +86 -0
- package/docs/types/badge.ComponentOption.html +86 -0
- package/docs/types/badge.DefaultDesignProps.html +86 -0
- package/docs/types/bau_ui.ChildDom.html +87 -0
- package/docs/types/bau_ui.Component.html +111 -0
- package/docs/types/bau_ui.ComponentGeneric.html +102 -0
- package/docs/types/bau_ui.ComponentOneChild.html +109 -0
- package/docs/types/bau_ui.ComponentOption.html +92 -0
- package/docs/types/bau_ui.ComponentWithProp.html +109 -0
- package/docs/types/breadcrumbs.BreadcrumbsProps.html +94 -0
- package/docs/types/breadcrumbs.Component.html +87 -0
- package/docs/types/breadcrumbs.ComponentGeneric.html +87 -0
- package/docs/types/breadcrumbs.ComponentOption.html +87 -0
- package/docs/types/breadcrumbs.DefaultDesignProps.html +87 -0
- package/docs/types/button.ButtonProps.html +93 -0
- package/docs/types/button.Component.html +86 -0
- package/docs/types/button.ComponentOption.html +86 -0
- package/docs/types/button.DefaultDesignProps.html +86 -0
- package/docs/types/buttonGroup.ButtonGroupProps.html +89 -0
- package/docs/types/buttonGroup.Component.html +86 -0
- package/docs/types/buttonGroup.ComponentOption.html +86 -0
- package/docs/types/buttonGroup.DefaultDesignProps.html +86 -0
- package/docs/types/calendar.CalendarProps.html +89 -0
- package/docs/types/calendar.Component.html +86 -0
- package/docs/types/calendar.ComponentOption.html +86 -0
- package/docs/types/calendar.DefaultDesignProps.html +86 -0
- package/docs/types/checkbox.CheckboxProps.html +89 -0
- package/docs/types/checkbox.Component.html +86 -0
- package/docs/types/checkbox.ComponentOption.html +86 -0
- package/docs/types/checkbox.DefaultDesignProps.html +86 -0
- package/docs/types/chip.ChipProps.html +89 -0
- package/docs/types/chip.Component.html +86 -0
- package/docs/types/chip.ComponentOption.html +86 -0
- package/docs/types/chip.DefaultDesignProps.html +86 -0
- package/docs/types/constants.Color.html +88 -0
- package/docs/types/constants.DefaultDesignProps.html +97 -0
- package/docs/types/constants.Size.html +88 -0
- package/docs/types/constants.Variant.html +88 -0
- package/docs/types/context.Context.html +107 -0
- package/docs/types/drawer.Component.html +86 -0
- package/docs/types/drawer.ComponentOption.html +86 -0
- package/docs/types/drawer.DefaultDesignProps.html +86 -0
- package/docs/types/drawer.DrawerProps.html +89 -0
- package/docs/types/drillDownMenu.Component.html +89 -0
- package/docs/types/drillDownMenu.ComponentGeneric.html +89 -0
- package/docs/types/drillDownMenu.ComponentOption.html +89 -0
- package/docs/types/drillDownMenu.DefaultDesignProps.html +89 -0
- package/docs/types/drillDownMenu.Option.html +116 -0
- package/docs/types/drillDownMenu.Tree.html +96 -0
- package/docs/types/drillDownMenu.TreeViewProps.html +94 -0
- package/docs/types/fileInput.Component.html +86 -0
- package/docs/types/fileInput.ComponentOption.html +86 -0
- package/docs/types/fileInput.DefaultDesignProps.html +86 -0
- package/docs/types/fileInput.FileInputProps.html +91 -0
- package/docs/types/form.Component.html +86 -0
- package/docs/types/form.ComponentOption.html +86 -0
- package/docs/types/form.DefaultDesignProps.html +86 -0
- package/docs/types/form.FormProps.html +89 -0
- package/docs/types/globalStyle.ColorDefs.html +85 -0
- package/docs/types/globalStyle.HSL.html +94 -0
- package/docs/types/globalStyle.StyleOption.html +90 -0
- package/docs/types/input.Component.html +86 -0
- package/docs/types/input.ComponentOption.html +86 -0
- package/docs/types/input.DefaultDesignProps.html +86 -0
- package/docs/types/input.InputProps.html +89 -0
- package/docs/types/list.Component.html +86 -0
- package/docs/types/list.ComponentOption.html +86 -0
- package/docs/types/list.DefaultDesignProps.html +86 -0
- package/docs/types/list.ListProps.html +89 -0
- package/docs/types/modal.Component.html +86 -0
- package/docs/types/modal.ComponentOption.html +86 -0
- package/docs/types/modal.DefaultDesignProps.html +86 -0
- package/docs/types/modal.ModalProps.html +89 -0
- package/docs/types/paper.Component.html +86 -0
- package/docs/types/paper.ComponentOption.html +86 -0
- package/docs/types/paper.DefaultDesignProps.html +86 -0
- package/docs/types/paper.PaperProps.html +89 -0
- package/docs/types/popover.Action.html +105 -0
- package/docs/types/popover.Component.html +86 -0
- package/docs/types/popover.ComponentOption.html +86 -0
- package/docs/types/popover.PopoverProps.html +89 -0
- package/docs/types/select.Component.html +86 -0
- package/docs/types/select.ComponentOption.html +86 -0
- package/docs/types/select.DefaultDesignProps.html +86 -0
- package/docs/types/select.SelectProps.html +121 -0
- package/docs/types/slider.Component.html +86 -0
- package/docs/types/slider.ComponentOption.html +86 -0
- package/docs/types/slider.DefaultDesignProps.html +86 -0
- package/docs/types/slider.SliderProps.html +89 -0
- package/docs/types/spinner.Component.html +86 -0
- package/docs/types/spinner.ComponentOption.html +86 -0
- package/docs/types/spinner.DefaultDesignProps.html +86 -0
- package/docs/types/spinner.SpinnerProps.html +91 -0
- package/docs/types/switch.Component.html +86 -0
- package/docs/types/switch.ComponentOption.html +86 -0
- package/docs/types/switch.DefaultDesignProps.html +86 -0
- package/docs/types/switch.SwitchProps.html +89 -0
- package/docs/types/tableContainer.Component.html +85 -0
- package/docs/types/tableContainer.ComponentOption.html +85 -0
- package/docs/types/tableContainer.TableProps.html +88 -0
- package/docs/types/tablePagination.Component.html +86 -0
- package/docs/types/tablePagination.ComponentOption.html +86 -0
- package/docs/types/tablePagination.TablePaginationProps.html +99 -0
- package/docs/types/tablePagination.onPageChange.html +110 -0
- package/docs/types/tabs.Component.html +90 -0
- package/docs/types/tabs.ComponentOption.html +90 -0
- package/docs/types/tabs.ComponentTab.html +90 -0
- package/docs/types/tabs.Option.html +95 -0
- package/docs/types/tabs.Tab.html +97 -0
- package/docs/types/tabs.TabPropBase.html +101 -0
- package/docs/types/tabs.Tabs.html +90 -0
- package/docs/types/tabs.TabsProps.html +93 -0
- package/docs/types/themeSwitch.Component.html +85 -0
- package/docs/types/themeSwitch.ComponentOption.html +85 -0
- package/docs/types/themeSwitch.ThemeSwitchProps.html +88 -0
- package/docs/types/tooltip.Component.html +86 -0
- package/docs/types/tooltip.ComponentOption.html +86 -0
- package/docs/types/tooltip.DefaultDesignProps.html +86 -0
- package/docs/types/tooltip.TooltipProps.html +91 -0
- package/docs/types/treeView.Component.html +89 -0
- package/docs/types/treeView.ComponentGeneric.html +89 -0
- package/docs/types/treeView.ComponentOption.html +89 -0
- package/docs/types/treeView.DefaultDesignProps.html +89 -0
- package/docs/types/treeView.Option.html +94 -0
- package/docs/types/treeView.Tree.html +98 -0
- package/docs/types/treeView.TreeViewProps.html +94 -0
- package/docs/variables/constants.Colors.html +88 -0
- package/docs/variables/constants.Sizes.html +88 -0
- package/docs/variables/constants.Variants.html +88 -0
- package/drillDownMenu/drillDownMenu.js +120 -106
- package/drillDownMenu/index.d.ts +1 -0
- package/fileInput/fileInput.js +8 -6
- package/form/form.js +62 -0
- package/form/index.d.ts +10 -0
- package/form/index.js +1 -0
- package/globalStyle/globalStyle.js +35 -13
- package/globalStyle/index.d.ts +14 -0
- package/input/input.js +13 -13
- package/linearProgress/index.d.ts +12 -0
- package/linearProgress/index.js +1 -0
- package/linearProgress/linearProgress.js +84 -0
- package/list/list.js +3 -11
- package/loadingButton/index.d.ts +12 -0
- package/loadingButton/index.js +1 -0
- package/loadingButton/loadingButton.js +70 -0
- package/modal/modal.js +25 -27
- package/package.json +10 -5
- package/pages/login/index.d.ts +3 -6
- package/pages/login/login.js +1 -1
- package/paginationNavigation/index.d.ts +10 -0
- package/paginationNavigation/index.js +1 -0
- package/paginationNavigation/paginationNavigation.js +78 -0
- package/paper/index.d.ts +10 -0
- package/paper/index.js +1 -0
- package/paper/paper.js +51 -0
- package/popover/popover.js +14 -3
- package/radioButton/index.d.ts +15 -0
- package/radioButton/index.js +1 -0
- package/radioButton/radioButton.js +49 -0
- package/select/select.js +21 -8
- package/spinner/index.d.ts +1 -3
- package/spinner/spinner.js +98 -55
- package/stepper/index.d.ts +28 -0
- package/stepper/index.js +1 -0
- package/stepper/stepper.js +159 -0
- package/tableContainer/tableContainer.js +2 -3
- package/tableOfContent/index.d.ts +10 -0
- package/tableOfContent/index.js +1 -0
- package/tableOfContent/tableOfContent.js +159 -0
- package/tabs/tabs.js +56 -56
- package/toggle/index.d.ts +10 -0
- package/toggle/index.js +1 -0
- package/toggle/toggle.js +106 -0
- package/toggleGroup/index.d.ts +13 -0
- package/toggleGroup/index.js +1 -0
- package/toggleGroup/toggleGroup.js +94 -0
- package/tooltip/tooltip.js +2 -7
- package/treeView/treeView.js +30 -88
- package/tsconfig.json +23 -0
package/form/form.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
|
+
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
3
|
+
|
|
4
|
+
export default function (context, options) {
|
|
5
|
+
const { bau, css } = context;
|
|
6
|
+
const { form } = bau.tags;
|
|
7
|
+
|
|
8
|
+
const className = css`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
gap: 1rem;
|
|
13
|
+
padding: 1rem;
|
|
14
|
+
min-width: 350px;
|
|
15
|
+
& > header {
|
|
16
|
+
text-align: center;
|
|
17
|
+
& h1 {
|
|
18
|
+
line-height: 0;
|
|
19
|
+
font-size: 1.3rem;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
& section {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 1rem;
|
|
26
|
+
}
|
|
27
|
+
& label {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 0.3rem;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
font-size: smaller;
|
|
33
|
+
color: var(--color-content-secondary);
|
|
34
|
+
}
|
|
35
|
+
& > footer {
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: 1rem;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
return function Form(...args) {
|
|
42
|
+
let [
|
|
43
|
+
{ color, variant = "outline", size = "md", content, ...props },
|
|
44
|
+
...children
|
|
45
|
+
] = toPropsAndChildren(args);
|
|
46
|
+
return form(
|
|
47
|
+
{
|
|
48
|
+
...props,
|
|
49
|
+
class: classNames(
|
|
50
|
+
"form",
|
|
51
|
+
color,
|
|
52
|
+
variant,
|
|
53
|
+
size,
|
|
54
|
+
className,
|
|
55
|
+
options?.class,
|
|
56
|
+
props?.class
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
...children
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
}
|
package/form/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/form" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type FormProps = {} & DefaultDesignProps;
|
|
6
|
+
|
|
7
|
+
type Component = import("../bau-ui").Component<FormProps>;
|
|
8
|
+
|
|
9
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
10
|
+
}
|
package/form/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./form";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const ColorPaletteDefault = [
|
|
2
|
-
["neutral", { h: "0", s: "0%", l: "
|
|
3
|
-
["primary", { h: "230", s: "
|
|
4
|
-
["secondary", { h: "338", s: "
|
|
5
|
-
["success", { h: "120", s: "
|
|
6
|
-
["info", { h: "194", s: "
|
|
7
|
-
["warning", { h: "43", s: "
|
|
8
|
-
["danger", { h: "358", s: "
|
|
2
|
+
["neutral", { h: "0", s: "0%", l: "50%" }],
|
|
3
|
+
["primary", { h: "230", s: "70%", l: "30%" }],
|
|
4
|
+
["secondary", { h: "338", s: "70%", l: "50%" }],
|
|
5
|
+
["success", { h: "120", s: "70%", l: "25%" }],
|
|
6
|
+
["info", { h: "194", s: "70%", l: "30%" }],
|
|
7
|
+
["warning", { h: "43", s: "70%", l: "25%" }],
|
|
8
|
+
["danger", { h: "358", s: "70%", l: "30%" }],
|
|
9
9
|
];
|
|
10
10
|
|
|
11
11
|
const SHADES_LIGHT = [
|
|
@@ -39,6 +39,11 @@ const variantToCss = () =>
|
|
|
39
39
|
`
|
|
40
40
|
).join("\n");
|
|
41
41
|
|
|
42
|
+
const darkColors = () =>
|
|
43
|
+
ColorPaletteDefault.map(([color]) => [
|
|
44
|
+
`--color-${color}-s: var(--color-${color}-dark-s);`,
|
|
45
|
+
]).join("\n");
|
|
46
|
+
|
|
42
47
|
const indexToColor = (index) => {
|
|
43
48
|
return 100 - index * 10;
|
|
44
49
|
};
|
|
@@ -66,8 +71,10 @@ export const buildEmphasis = ({ dark }) =>
|
|
|
66
71
|
const buildColor = ([color, { h, s, l }]) =>
|
|
67
72
|
[
|
|
68
73
|
`--color-${color}-h: ${h};`,
|
|
69
|
-
`--color-${color}-s: ${s};`,
|
|
70
74
|
`--color-${color}-l: ${l};`,
|
|
75
|
+
`--color-${color}-base-s: ${s};`,
|
|
76
|
+
`--color-${color}-s: var(--color-${color}-base-s);`,
|
|
77
|
+
`--color-${color}-dark-s: calc(${s} - 25%);`,
|
|
71
78
|
`--color-${color}-hsl: var(--color-${color}-h), var(--color-${color}-s), var(--color-${color}-l);`,
|
|
72
79
|
`--color-${color}: hsl(var(--color-${color}-hsl));`,
|
|
73
80
|
...SHADES_LIGHT.map(
|
|
@@ -99,7 +106,6 @@ export default function globalStyle(
|
|
|
99
106
|
${buildGrays()}
|
|
100
107
|
${buildEmphasis({})}
|
|
101
108
|
${variantToCss()}
|
|
102
|
-
|
|
103
109
|
--color-content: hsl(0, 0%, 10%);
|
|
104
110
|
--color-content-inverse: hsl(0, 0%, 95%);
|
|
105
111
|
--color-content-secondary: hsl(0, 0%, 30%);
|
|
@@ -122,12 +128,15 @@ export default function globalStyle(
|
|
|
122
128
|
--transition-fast: 200ms;
|
|
123
129
|
--transition-slow: 400ms;
|
|
124
130
|
--shadow-s: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
|
|
125
|
-
--shadow-m: 0
|
|
131
|
+
--shadow-m: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
|
|
132
|
+
0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
|
|
133
|
+
--shadow-lg: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
|
|
134
|
+
0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
|
|
126
135
|
--font-size-base: 100%;
|
|
127
136
|
--line-height-base: 1.65;
|
|
128
137
|
--link-color: var(--color-primary);
|
|
129
|
-
--brightness-hover-always:
|
|
130
|
-
--brightness-active-always:
|
|
138
|
+
--brightness-hover-always: 120%;
|
|
139
|
+
--brightness-active-always: 130%;
|
|
131
140
|
--brightness-hover: 80%;
|
|
132
141
|
--brightness-hover-reverse: 140%;
|
|
133
142
|
--brightness-active: 90%;
|
|
@@ -144,7 +153,7 @@ export default function globalStyle(
|
|
|
144
153
|
font-size: 0.8rem;
|
|
145
154
|
}
|
|
146
155
|
.md {
|
|
147
|
-
font-size:
|
|
156
|
+
font-size: 1rem;
|
|
148
157
|
}
|
|
149
158
|
.lg {
|
|
150
159
|
font-size: 1.2rem;
|
|
@@ -157,6 +166,19 @@ export default function globalStyle(
|
|
|
157
166
|
font: var(--font-size-base) / var(--line-height-base) var(--font-family);
|
|
158
167
|
background-color: var(--background-color);
|
|
159
168
|
}
|
|
169
|
+
html[data-theme="dark"] {
|
|
170
|
+
${darkColors()}
|
|
171
|
+
--color-scheme: dark;
|
|
172
|
+
--background-color: #121212;
|
|
173
|
+
--hover-overlay: rgba(255, 255, 255, 0.05);
|
|
174
|
+
--color-content: #e3e3e3;
|
|
175
|
+
--color-content-secondary: rgba(255, 255, 255, 0.7);
|
|
176
|
+
--brightness-hover-always: 130%;
|
|
177
|
+
--brightness-active-always: 120%;
|
|
178
|
+
--brightness-active: 180%;
|
|
179
|
+
--brightness-hover: 150%;
|
|
180
|
+
--brightness-hover-reverse: 70% ${buildEmphasis({ dark: true })};
|
|
181
|
+
}
|
|
160
182
|
body {
|
|
161
183
|
margin: 0;
|
|
162
184
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/globalStyle" {
|
|
2
|
+
type HSL = {
|
|
3
|
+
h: string;
|
|
4
|
+
s: string;
|
|
5
|
+
l: string;
|
|
6
|
+
};
|
|
7
|
+
export type ColorDefs = [name: any, hsl: HSL];
|
|
8
|
+
|
|
9
|
+
type StyleOption = {
|
|
10
|
+
colorPalette: ColorDefs[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function (context: any, option?: StyleOption): void;
|
|
14
|
+
}
|
package/input/input.js
CHANGED
|
@@ -16,14 +16,9 @@ const colorsToCss = () =>
|
|
|
16
16
|
&.input.outline.${color} {
|
|
17
17
|
border: 1px solid var(--color-${color});
|
|
18
18
|
&:focus {
|
|
19
|
-
|
|
19
|
+
outline: 4px auto var(--color-${color});
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
&.input.soft.${color} {
|
|
23
|
-
&:focus {
|
|
24
|
-
border-color: var(--color-${color});
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
22
|
&.input.solid.${color} {
|
|
28
23
|
&:focus {
|
|
29
24
|
border-color: var(--color-${color});
|
|
@@ -39,7 +34,7 @@ const colorsToCss = () =>
|
|
|
39
34
|
`
|
|
40
35
|
).join("\n");
|
|
41
36
|
|
|
42
|
-
export default function (context, options) {
|
|
37
|
+
export default function (context, options = {}) {
|
|
43
38
|
const { bau, css } = context;
|
|
44
39
|
const { input } = bau.tags;
|
|
45
40
|
|
|
@@ -54,6 +49,10 @@ export default function (context, options) {
|
|
|
54
49
|
&.input:hover {
|
|
55
50
|
background-color: var(--color-emphasis-100);
|
|
56
51
|
}
|
|
52
|
+
&.input:disabled {
|
|
53
|
+
filter: grayscale(100%);
|
|
54
|
+
background-color: var(--color-emphasis-100);
|
|
55
|
+
}
|
|
57
56
|
&.sm {
|
|
58
57
|
padding: 0.4rem;
|
|
59
58
|
}
|
|
@@ -68,24 +67,25 @@ export default function (context, options) {
|
|
|
68
67
|
|
|
69
68
|
return function Input(props) {
|
|
70
69
|
const {
|
|
71
|
-
size = "md",
|
|
72
|
-
variant = "outline",
|
|
73
|
-
color = "neutral",
|
|
74
|
-
name,
|
|
75
|
-
id,
|
|
70
|
+
size = options.size ?? "md",
|
|
71
|
+
variant = options.variant ?? "outline",
|
|
72
|
+
color = options.color ?? "neutral",
|
|
76
73
|
disabled,
|
|
77
74
|
...otherProps
|
|
78
75
|
} = props;
|
|
79
76
|
|
|
80
77
|
return input({
|
|
78
|
+
type: "text",
|
|
81
79
|
...otherProps,
|
|
80
|
+
disabled,
|
|
82
81
|
class: classNames(
|
|
83
82
|
"input",
|
|
83
|
+
options.class,
|
|
84
84
|
size,
|
|
85
85
|
color,
|
|
86
86
|
variant,
|
|
87
87
|
className,
|
|
88
|
-
|
|
88
|
+
disabled && "disabled",
|
|
89
89
|
otherProps.class
|
|
90
90
|
),
|
|
91
91
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/linearProgress" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type LinearProgressProps = {
|
|
6
|
+
running: boolean | import("@grucloud/bau").State<boolean>;
|
|
7
|
+
} & DefaultDesignProps;
|
|
8
|
+
|
|
9
|
+
type Component = import("../bau-ui").Component<LinearProgressProps>;
|
|
10
|
+
|
|
11
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./linearProgress";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
|
+
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
3
|
+
import { Colors } from "../constants.js";
|
|
4
|
+
|
|
5
|
+
export default function (context, options) {
|
|
6
|
+
const { bau, css, keyframes } = context;
|
|
7
|
+
const { div } = bau.tags;
|
|
8
|
+
|
|
9
|
+
const colorsToCss = () =>
|
|
10
|
+
Colors.map(
|
|
11
|
+
(color) =>
|
|
12
|
+
`
|
|
13
|
+
&.${color}{
|
|
14
|
+
background-color: var(--color-${color});
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
).join("\n");
|
|
18
|
+
|
|
19
|
+
const stripes = keyframes`
|
|
20
|
+
0% {
|
|
21
|
+
background-position: 0rem 0;
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
background-position: 1rem 0;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const className = css`
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 5px;
|
|
31
|
+
background-image: linear-gradient(
|
|
32
|
+
45deg,
|
|
33
|
+
rgba(255, 255, 255, 0.15) 25%,
|
|
34
|
+
transparent 25%,
|
|
35
|
+
transparent 50%,
|
|
36
|
+
rgba(255, 255, 255, 0.15) 50%,
|
|
37
|
+
rgba(255, 255, 255, 0.15) 75%,
|
|
38
|
+
transparent 75%,
|
|
39
|
+
transparent
|
|
40
|
+
);
|
|
41
|
+
background-size: 1rem 1rem;
|
|
42
|
+
transition: all 0.3s linear;
|
|
43
|
+
opacity: 0;
|
|
44
|
+
&.running {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
animation: ${stripes} 1s linear infinite;
|
|
47
|
+
}
|
|
48
|
+
&.sm {
|
|
49
|
+
height: 0.2rem;
|
|
50
|
+
}
|
|
51
|
+
&.md {
|
|
52
|
+
height: 0.5rem;
|
|
53
|
+
}
|
|
54
|
+
&.lg {
|
|
55
|
+
height: 1rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
${colorsToCss()}
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
return function LinearProgress(...args) {
|
|
62
|
+
let [
|
|
63
|
+
{ color = "neutral", variant = "plain", size = "md", running, ...props },
|
|
64
|
+
] = toPropsAndChildren(args);
|
|
65
|
+
|
|
66
|
+
return div({
|
|
67
|
+
...props,
|
|
68
|
+
role: "progressbar",
|
|
69
|
+
class: {
|
|
70
|
+
deps: [running],
|
|
71
|
+
renderProp: () => (running) =>
|
|
72
|
+
classNames(
|
|
73
|
+
"linearProgress",
|
|
74
|
+
size,
|
|
75
|
+
color,
|
|
76
|
+
className,
|
|
77
|
+
running && "running",
|
|
78
|
+
options?.class,
|
|
79
|
+
props?.class
|
|
80
|
+
),
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
}
|
package/list/list.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
2
|
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
3
|
-
import { Colors } from "../constants.js";
|
|
4
3
|
|
|
5
4
|
export default function (context, options) {
|
|
6
5
|
const { bau, css } = context;
|
|
7
6
|
const { ul } = bau.tags;
|
|
8
7
|
|
|
9
|
-
const colorsToCss = () =>
|
|
10
|
-
Colors.map(
|
|
11
|
-
(color) =>
|
|
12
|
-
`
|
|
13
|
-
`
|
|
14
|
-
).join("\n");
|
|
15
|
-
|
|
16
8
|
const className = css`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
17
11
|
list-style: none;
|
|
18
12
|
padding: 0;
|
|
19
13
|
margin: 0 0;
|
|
@@ -25,13 +19,12 @@ export default function (context, options) {
|
|
|
25
19
|
filter: brightness(var(--brightness-active-always));
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
|
-
& li {
|
|
22
|
+
& > li {
|
|
29
23
|
padding: 0.4rem;
|
|
30
24
|
cursor: pointer;
|
|
31
25
|
background-color: inherit;
|
|
32
26
|
transition: all var(--transition-slow) ease-out;
|
|
33
27
|
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
28
|
&:hover {
|
|
36
29
|
filter: brightness(var(--brightness-hover));
|
|
37
30
|
}
|
|
@@ -39,7 +32,6 @@ export default function (context, options) {
|
|
|
39
32
|
filter: brightness(var(--brightness-active));
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
|
-
${colorsToCss()}
|
|
43
35
|
`;
|
|
44
36
|
|
|
45
37
|
return function List(...args) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/loadingButton" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type LoadingButtonProps = {
|
|
6
|
+
loading: boolean | import("@grucloud/bau").State<boolean>;
|
|
7
|
+
} & DefaultDesignProps;
|
|
8
|
+
|
|
9
|
+
type Component = import("../bau-ui").Component<LoadingButtonProps>;
|
|
10
|
+
|
|
11
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./loadingButton";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
|
+
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
3
|
+
import button from "../button";
|
|
4
|
+
import spinner from "../spinner";
|
|
5
|
+
|
|
6
|
+
export default function (context, options) {
|
|
7
|
+
const { bau, css, keyframes } = context;
|
|
8
|
+
const { span } = bau.tags;
|
|
9
|
+
|
|
10
|
+
const fadeOut = keyframes`
|
|
11
|
+
0% {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const className = css`
|
|
20
|
+
position: relative;
|
|
21
|
+
&:hover.loading {
|
|
22
|
+
cursor: default;
|
|
23
|
+
}
|
|
24
|
+
& .spinner {
|
|
25
|
+
position: absolute;
|
|
26
|
+
}
|
|
27
|
+
& span {
|
|
28
|
+
&.loading {
|
|
29
|
+
animation: ${fadeOut} 0.5s;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
&.md {
|
|
34
|
+
padding-left: 0.5rem;
|
|
35
|
+
padding-right: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
return function LoadingButton(...args) {
|
|
40
|
+
let [
|
|
41
|
+
{ color, variant = "plain", size = "md", loading, ...props },
|
|
42
|
+
...children
|
|
43
|
+
] = toPropsAndChildren(args);
|
|
44
|
+
|
|
45
|
+
const Button = button(context);
|
|
46
|
+
const Spinner = spinner(context);
|
|
47
|
+
|
|
48
|
+
return bau.bind({
|
|
49
|
+
deps: [loading],
|
|
50
|
+
render: () => (loading) =>
|
|
51
|
+
Button(
|
|
52
|
+
{
|
|
53
|
+
...props,
|
|
54
|
+
class: classNames(
|
|
55
|
+
"loadingButton",
|
|
56
|
+
size,
|
|
57
|
+
variant,
|
|
58
|
+
color,
|
|
59
|
+
className,
|
|
60
|
+
loading && "loading",
|
|
61
|
+
options?.class,
|
|
62
|
+
props?.class
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
Spinner({ size, variant, color, visibility: loading }),
|
|
66
|
+
span({ class: loading && "loading" }, children)
|
|
67
|
+
),
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
}
|
package/modal/modal.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Colors } from "../constants.js";
|
|
|
4
4
|
|
|
5
5
|
export default function (context, options) {
|
|
6
6
|
const { bau, css } = context;
|
|
7
|
-
const { dialog } = bau.tags;
|
|
7
|
+
const { dialog, div } = bau.tags;
|
|
8
8
|
|
|
9
9
|
const colorsToCss = () =>
|
|
10
10
|
Colors.map(
|
|
@@ -20,7 +20,6 @@ export default function (context, options) {
|
|
|
20
20
|
color: inherit;
|
|
21
21
|
}
|
|
22
22
|
&.modal.solid.${color} {
|
|
23
|
-
|
|
24
23
|
}
|
|
25
24
|
`
|
|
26
25
|
).join("\n");
|
|
@@ -28,34 +27,33 @@ export default function (context, options) {
|
|
|
28
27
|
const className = css`
|
|
29
28
|
box-shadow: var(--shadow-s);
|
|
30
29
|
background-color: var(--background-color);
|
|
31
|
-
|
|
32
|
-
left: 0;
|
|
33
|
-
max-height: 90vh;
|
|
34
|
-
max-width: 95vw;
|
|
35
|
-
transition: transform 0.3s ease-out;
|
|
36
|
-
border-radius: 10px;
|
|
30
|
+
border-radius: var(--global-radius);
|
|
37
31
|
min-width: 400px;
|
|
38
|
-
padding:
|
|
32
|
+
padding: 1rem;
|
|
39
33
|
border: 0px;
|
|
40
|
-
|
|
41
|
-
padding: 1rem;
|
|
42
|
-
font-size: 1.8rem;
|
|
43
|
-
font-weight: 800;
|
|
44
|
-
text-align: center;
|
|
45
|
-
}
|
|
46
|
-
& footer {
|
|
34
|
+
> div {
|
|
47
35
|
display: flex;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
max-height: 90vh;
|
|
39
|
+
max-width: 95vw;
|
|
40
|
+
& > header {
|
|
41
|
+
font-size: 1.5rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
}
|
|
44
|
+
& > main,
|
|
45
|
+
> section {
|
|
46
|
+
flex-grow: 1;
|
|
47
|
+
overflow-y: auto;
|
|
48
|
+
}
|
|
49
|
+
& > footer {
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: flex-end;
|
|
52
|
+
padding: 1rem;
|
|
53
|
+
gap: 1rem;
|
|
54
|
+
}
|
|
58
55
|
}
|
|
56
|
+
|
|
59
57
|
${colorsToCss()}
|
|
60
58
|
`;
|
|
61
59
|
|
|
@@ -77,7 +75,7 @@ export default function (context, options) {
|
|
|
77
75
|
props?.class
|
|
78
76
|
),
|
|
79
77
|
},
|
|
80
|
-
...children
|
|
78
|
+
div(...children)
|
|
81
79
|
);
|
|
82
80
|
};
|
|
83
81
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grucloud/bau-ui",
|
|
3
3
|
"description": "Components library built with Bau",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.43.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BSD",
|
|
7
7
|
"keywords": [
|
|
@@ -11,15 +11,20 @@
|
|
|
11
11
|
"CSS in JS"
|
|
12
12
|
],
|
|
13
13
|
"author": "Frederic Heem",
|
|
14
|
-
"scripts": {
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typedoc": "typedoc --exclude myComponent/index.d.ts *.d.ts **/*.d.ts "
|
|
16
|
+
},
|
|
15
17
|
"repository": {
|
|
16
18
|
"type": "git",
|
|
17
19
|
"url": "git@github.com:grucloud/bau.git",
|
|
18
20
|
"directory": "bau-ui"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"@grucloud/bau": "^0.
|
|
22
|
-
"@grucloud/bau-css": "^0.
|
|
23
|
+
"@grucloud/bau": "^0.43.0",
|
|
24
|
+
"@grucloud/bau-css": "^0.43.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"typedoc": "0.24.8"
|
|
23
28
|
},
|
|
24
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "a94355d33ce24d2db1fd729b632360144d6565c2"
|
|
25
30
|
}
|
package/pages/login/index.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
declare module "@grucloud/bau-ui/pages/login" {
|
|
2
|
-
type ComponentOption = import("
|
|
2
|
+
type ComponentOption = import("../../bau-ui").ComponentOption;
|
|
3
3
|
|
|
4
|
-
export type LoginProps = {
|
|
5
|
-
// severity: string;
|
|
6
|
-
// onRemove?: Function;
|
|
7
|
-
};
|
|
4
|
+
export type LoginProps = {};
|
|
8
5
|
|
|
9
|
-
type Component = import("
|
|
6
|
+
type Component = import("../../bau-ui").Component<LoginProps>;
|
|
10
7
|
|
|
11
8
|
export default function (context: any): Component;
|
|
12
9
|
}
|
package/pages/login/login.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/paginationNavigation" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type PaginationNavigationProps = {} & DefaultDesignProps;
|
|
6
|
+
|
|
7
|
+
type Component = import("../bau-ui").Component<PaginationNavigationProps>;
|
|
8
|
+
|
|
9
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./paginationNavigation";
|