@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
|
@@ -0,0 +1,78 @@
|
|
|
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, config } = context;
|
|
6
|
+
const { div, a, span, nav } = bau.tags;
|
|
7
|
+
|
|
8
|
+
const className = css`
|
|
9
|
+
margin-top: 3rem;
|
|
10
|
+
margin-bottom: 1rem;
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-area: paginationnav;
|
|
13
|
+
gap: var(--spacing-horizontal);
|
|
14
|
+
grid-template-columns: repeat(2, 1fr);
|
|
15
|
+
& > a {
|
|
16
|
+
padding: 0.5rem 1rem;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
border: 1px solid var(--color-emphasis-300);
|
|
19
|
+
border-radius: var(--global-radius);
|
|
20
|
+
transition: border-color var(--transition-slow);
|
|
21
|
+
&:hover {
|
|
22
|
+
border-color: var(--color-primary);
|
|
23
|
+
}
|
|
24
|
+
.sublabel {
|
|
25
|
+
color: var(--color-content-secondary);
|
|
26
|
+
font-size: 0.8rem;
|
|
27
|
+
font-weight: var(--font-weight-semibold);
|
|
28
|
+
margin-bottom: 0.25rem;
|
|
29
|
+
}
|
|
30
|
+
.label {
|
|
31
|
+
color: var(--link-color);
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
font-weight: var(--font-weight-bold);
|
|
34
|
+
}
|
|
35
|
+
.Previous {
|
|
36
|
+
&::before {
|
|
37
|
+
content: "« ";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.Next {
|
|
41
|
+
&::after {
|
|
42
|
+
content: " »";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const Link =
|
|
49
|
+
({ text }) =>
|
|
50
|
+
({ name, label, href }) =>
|
|
51
|
+
a(
|
|
52
|
+
{ href: `${config.base}${href}` },
|
|
53
|
+
span({ class: "sublabel" }, text),
|
|
54
|
+
div({ class: `label ${text}` }, label ?? name)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return function PaginationNavigation(...args) {
|
|
58
|
+
let [{ color, variant = "plain", size = "md", data = {}, ...props }] =
|
|
59
|
+
toPropsAndChildren(args);
|
|
60
|
+
const { next, previous } = data;
|
|
61
|
+
return nav(
|
|
62
|
+
{
|
|
63
|
+
"data-paginationnav": JSON.stringify(data),
|
|
64
|
+
"aria-label": "pages navigation",
|
|
65
|
+
...props,
|
|
66
|
+
class: classNames(
|
|
67
|
+
"paginationNavigation",
|
|
68
|
+
size,
|
|
69
|
+
className,
|
|
70
|
+
options?.class,
|
|
71
|
+
props?.class
|
|
72
|
+
),
|
|
73
|
+
},
|
|
74
|
+
previous?.href && Link({ text: "Previous" })(previous),
|
|
75
|
+
next?.href && Link({ text: "Next" })(next)
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
}
|
package/paper/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/paper" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type PaperProps = {} & DefaultDesignProps;
|
|
6
|
+
|
|
7
|
+
type Component = import("../bau-ui").Component<PaperProps>;
|
|
8
|
+
|
|
9
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
10
|
+
}
|
package/paper/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./paper";
|
package/paper/paper.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
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 { div } = bau.tags;
|
|
7
|
+
const className = css`
|
|
8
|
+
border: 1px solid transparent;
|
|
9
|
+
height: fit-content;
|
|
10
|
+
border-radius: var(--global-radius);
|
|
11
|
+
&.sm {
|
|
12
|
+
box-shadow: var(--shadow-s);
|
|
13
|
+
background-image: linear-gradient(
|
|
14
|
+
rgba(255, 255, 255, 0.03),
|
|
15
|
+
rgba(255, 255, 255, 0.03)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
&.md {
|
|
19
|
+
box-shadow: var(--shadow-m);
|
|
20
|
+
background-image: linear-gradient(
|
|
21
|
+
rgba(255, 255, 255, 0.05),
|
|
22
|
+
rgba(255, 255, 255, 0.05)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
&.lg {
|
|
26
|
+
box-shadow: var(--shadow-lg);
|
|
27
|
+
background-image: linear-gradient(
|
|
28
|
+
rgba(255, 255, 255, 0.1),
|
|
29
|
+
rgba(255, 255, 255, 0.1)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
return function Paper(...args) {
|
|
35
|
+
let [{ color, variant = "outline", size = "md", ...props }, ...children] =
|
|
36
|
+
toPropsAndChildren(args);
|
|
37
|
+
return div(
|
|
38
|
+
{
|
|
39
|
+
...props,
|
|
40
|
+
class: classNames(
|
|
41
|
+
"paper",
|
|
42
|
+
size,
|
|
43
|
+
className,
|
|
44
|
+
options?.class,
|
|
45
|
+
props?.class
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
...children
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
}
|
package/popover/popover.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import paper from "../paper";
|
|
1
2
|
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
3
|
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
3
4
|
|
|
4
5
|
export default function (context, options) {
|
|
5
6
|
const { bau, css, window } = context;
|
|
6
7
|
const { dialog } = bau.tags;
|
|
8
|
+
const Paper = paper(context, {
|
|
9
|
+
class: css`
|
|
10
|
+
&.paper {
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
`,
|
|
14
|
+
});
|
|
7
15
|
|
|
8
16
|
const className = css`
|
|
9
17
|
width: fit-content;
|
|
@@ -34,11 +42,14 @@ export default function (context, options) {
|
|
|
34
42
|
} else {
|
|
35
43
|
dialogEl.style.left = rectAnchor.right - rectDialog.width + "px";
|
|
36
44
|
}
|
|
37
|
-
|
|
38
45
|
if (rectAnchor.y < window.innerHeight / 2) {
|
|
39
46
|
dialogEl.style.top = rectAnchor.top + rectAnchor.height + "px";
|
|
40
47
|
} else {
|
|
41
|
-
dialogEl.style.top =
|
|
48
|
+
dialogEl.style.top =
|
|
49
|
+
Math.max(0, rectAnchor.top - rectDialog.height) + "px";
|
|
50
|
+
if (rectDialog.height > rectAnchor.top) {
|
|
51
|
+
dialogEl.style.height = rectAnchor.top + "px";
|
|
52
|
+
}
|
|
42
53
|
}
|
|
43
54
|
};
|
|
44
55
|
|
|
@@ -58,7 +69,7 @@ export default function (context, options) {
|
|
|
58
69
|
onclick: (event) =>
|
|
59
70
|
event.target === dialogEl && (closeDialog(), onClose?.call()),
|
|
60
71
|
},
|
|
61
|
-
contentEl
|
|
72
|
+
Paper(contentEl)
|
|
62
73
|
);
|
|
63
74
|
|
|
64
75
|
dialogEl.closeDialog = closeDialog;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/radioButton" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type RadioButtonProps = {
|
|
6
|
+
value: string | import("@grucloud/bau").State<string>;
|
|
7
|
+
} & DefaultDesignProps;
|
|
8
|
+
|
|
9
|
+
type Component = import("../bau-ui").Component<
|
|
10
|
+
RadioButtonProps,
|
|
11
|
+
HTMLInputElement
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./radioButton";
|
|
@@ -0,0 +1,49 @@
|
|
|
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 } = context;
|
|
7
|
+
const { input } = bau.tags;
|
|
8
|
+
|
|
9
|
+
const colorsToCss = () =>
|
|
10
|
+
Colors.map(
|
|
11
|
+
(color) =>
|
|
12
|
+
`
|
|
13
|
+
&.radio-button.${color} {
|
|
14
|
+
accent-color: var(--color-${color});
|
|
15
|
+
}
|
|
16
|
+
`
|
|
17
|
+
).join("\n");
|
|
18
|
+
|
|
19
|
+
const className = css`
|
|
20
|
+
&.sm {
|
|
21
|
+
transform: scale(0.8);
|
|
22
|
+
}
|
|
23
|
+
&.md {
|
|
24
|
+
}
|
|
25
|
+
&.lg {
|
|
26
|
+
transform: scale(1.5);
|
|
27
|
+
}
|
|
28
|
+
${colorsToCss()}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
return function RadioButton(...args) {
|
|
32
|
+
let [{ color = "neutral", variant = "plain", size = "md", ...props }] =
|
|
33
|
+
toPropsAndChildren(args);
|
|
34
|
+
|
|
35
|
+
return input({
|
|
36
|
+
...props,
|
|
37
|
+
type: "radio",
|
|
38
|
+
class: classNames(
|
|
39
|
+
"radio-button",
|
|
40
|
+
size,
|
|
41
|
+
color,
|
|
42
|
+
variant,
|
|
43
|
+
className,
|
|
44
|
+
options?.class,
|
|
45
|
+
props?.class
|
|
46
|
+
),
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
package/select/select.js
CHANGED
|
@@ -21,12 +21,16 @@ const colorsToCss = () =>
|
|
|
21
21
|
|
|
22
22
|
export default function (context, componentOptions) {
|
|
23
23
|
const { bau, css } = context;
|
|
24
|
-
const { div, li } = bau.tags;
|
|
24
|
+
const { div, li, select, option } = bau.tags;
|
|
25
25
|
const Button = button(context);
|
|
26
26
|
const Popover = popover(context);
|
|
27
27
|
const List = list(context);
|
|
28
28
|
|
|
29
29
|
const className = css`
|
|
30
|
+
& select {
|
|
31
|
+
width: 0;
|
|
32
|
+
height: 0;
|
|
33
|
+
}
|
|
30
34
|
& button {
|
|
31
35
|
&::after {
|
|
32
36
|
content: "\u25BC";
|
|
@@ -36,17 +40,12 @@ export default function (context, componentOptions) {
|
|
|
36
40
|
${colorsToCss()}
|
|
37
41
|
`;
|
|
38
42
|
|
|
39
|
-
const inputState = bau.state("");
|
|
40
|
-
const openState = bau.state(false);
|
|
41
|
-
const itemIndexActive = bau.state(0);
|
|
42
|
-
|
|
43
43
|
return function Select(...args) {
|
|
44
44
|
let [
|
|
45
45
|
{
|
|
46
46
|
color = "neutral",
|
|
47
47
|
variant = "outline",
|
|
48
48
|
size = "md",
|
|
49
|
-
id,
|
|
50
49
|
label,
|
|
51
50
|
Option,
|
|
52
51
|
options,
|
|
@@ -56,6 +55,10 @@ export default function (context, componentOptions) {
|
|
|
56
55
|
...children
|
|
57
56
|
] = toPropsAndChildren(args);
|
|
58
57
|
|
|
58
|
+
const inputState = bau.state("");
|
|
59
|
+
const openState = bau.state(false);
|
|
60
|
+
const itemIndexActive = bau.state(0);
|
|
61
|
+
|
|
59
62
|
const dialogOpen = () => {
|
|
60
63
|
popoverEl.openDialog();
|
|
61
64
|
popoverEl.focus();
|
|
@@ -77,15 +80,18 @@ export default function (context, componentOptions) {
|
|
|
77
80
|
} else {
|
|
78
81
|
dialogClose();
|
|
79
82
|
}
|
|
83
|
+
event.preventDefault();
|
|
80
84
|
};
|
|
81
85
|
|
|
82
86
|
const onclickItem =
|
|
83
87
|
({ option, index }) =>
|
|
84
88
|
(event) => {
|
|
85
89
|
inputState.val = getOptionLabel(option);
|
|
90
|
+
selectEl.value = inputState.val;
|
|
91
|
+
selectEl.setCustomValidity("");
|
|
86
92
|
itemIndexActive.val = index;
|
|
87
|
-
|
|
88
93
|
dialogClose();
|
|
94
|
+
event.preventDefault();
|
|
89
95
|
};
|
|
90
96
|
|
|
91
97
|
const onkeydown = (event) => {
|
|
@@ -150,11 +156,17 @@ export default function (context, componentOptions) {
|
|
|
150
156
|
);
|
|
151
157
|
|
|
152
158
|
const popoverEl = Popover({
|
|
153
|
-
id,
|
|
159
|
+
// id,
|
|
154
160
|
triggerEl: buttonEl,
|
|
155
161
|
contentEl: Content(),
|
|
156
162
|
onClose,
|
|
157
163
|
});
|
|
164
|
+
// Hidden select, required to save the value.
|
|
165
|
+
const selectEl = select(
|
|
166
|
+
props,
|
|
167
|
+
option({ value: "" }, "--Select Category--"),
|
|
168
|
+
options.map((opt) => option(getOptionLabel(opt)))
|
|
169
|
+
);
|
|
158
170
|
|
|
159
171
|
return div(
|
|
160
172
|
{
|
|
@@ -169,6 +181,7 @@ export default function (context, componentOptions) {
|
|
|
169
181
|
),
|
|
170
182
|
onkeydown,
|
|
171
183
|
},
|
|
184
|
+
selectEl,
|
|
172
185
|
buttonEl,
|
|
173
186
|
popoverEl
|
|
174
187
|
);
|
package/spinner/index.d.ts
CHANGED
|
@@ -3,9 +3,7 @@ declare module "@grucloud/bau-ui/spinner" {
|
|
|
3
3
|
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
4
|
|
|
5
5
|
export type SpinnerProps = {
|
|
6
|
-
|
|
7
|
-
//color?: "primary" | "secondary" | "warning" | "danger" | "info" | "success";
|
|
8
|
-
visibility?: boolean;
|
|
6
|
+
visibility?: boolean | import("@grucloud/bau").State<boolean>;
|
|
9
7
|
} & DefaultDesignProps;
|
|
10
8
|
|
|
11
9
|
type Component = import("../bau-ui").Component<SpinnerProps>;
|
package/spinner/spinner.js
CHANGED
|
@@ -1,78 +1,121 @@
|
|
|
1
1
|
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
|
+
import { Colors } from "../constants.js";
|
|
2
3
|
|
|
3
4
|
const sizeToPixel = {
|
|
4
|
-
sm:
|
|
5
|
-
md:
|
|
6
|
-
lg:
|
|
5
|
+
sm: 12,
|
|
6
|
+
md: 16,
|
|
7
|
+
lg: 24,
|
|
7
8
|
};
|
|
8
9
|
|
|
10
|
+
const colorsToCss = () =>
|
|
11
|
+
Colors.map(
|
|
12
|
+
(color) =>
|
|
13
|
+
`
|
|
14
|
+
&.${color} {
|
|
15
|
+
background-color:transparent;
|
|
16
|
+
}
|
|
17
|
+
&.plain.${color} {
|
|
18
|
+
& .path {
|
|
19
|
+
stroke: var(--color-${color});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
&.outline.${color} {
|
|
23
|
+
border: none;
|
|
24
|
+
& .path {
|
|
25
|
+
stroke: var(--color-${color});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
&.solid.${color} {
|
|
29
|
+
background-color:transparent;
|
|
30
|
+
& .path {
|
|
31
|
+
stroke: var(--font-color-inverse);
|
|
32
|
+
;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`
|
|
36
|
+
).join("\n");
|
|
37
|
+
|
|
9
38
|
export default function (context, options = {}) {
|
|
10
|
-
const { bau, css } = context;
|
|
39
|
+
const { bau, css, keyframes } = context;
|
|
40
|
+
const { svg, circle } = bau.tagsNS("http://www.w3.org/2000/svg");
|
|
11
41
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
42
|
+
const rotate = keyframes`
|
|
43
|
+
100% {
|
|
44
|
+
transform: rotate(360deg);
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const dash = keyframes`
|
|
48
|
+
0% {
|
|
49
|
+
stroke-dasharray: 1, 150;
|
|
50
|
+
stroke-dashoffset: 0;
|
|
51
|
+
}
|
|
52
|
+
50% {
|
|
53
|
+
stroke-dasharray: 90, 150;
|
|
54
|
+
stroke-dashoffset: -35;
|
|
55
|
+
}
|
|
56
|
+
100% {
|
|
57
|
+
stroke-dasharray: 90, 150;
|
|
58
|
+
stroke-dashoffset: -124;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
15
61
|
|
|
16
62
|
return function Spinner({
|
|
17
|
-
size = "md",
|
|
18
|
-
color =
|
|
19
|
-
variant = "outline",
|
|
63
|
+
size = options.size ?? "md",
|
|
64
|
+
color = options.color ?? "primary",
|
|
65
|
+
variant = options.variant ?? "outline",
|
|
20
66
|
visibility = true,
|
|
21
67
|
...otherProps
|
|
22
68
|
} = {}) {
|
|
69
|
+
const className = css`
|
|
70
|
+
visibility: hidden;
|
|
71
|
+
opacity: 0;
|
|
72
|
+
transition: all var(--transition-slow) ease-in-out;
|
|
73
|
+
&.visibility {
|
|
74
|
+
visibility: visible;
|
|
75
|
+
opacity: 1;
|
|
76
|
+
}
|
|
77
|
+
animation: ${rotate} 2s linear infinite;
|
|
78
|
+
width: ${sizeToPixel[size]};
|
|
79
|
+
height: ${sizeToPixel[size]};
|
|
80
|
+
& .path {
|
|
81
|
+
stroke-linecap: round;
|
|
82
|
+
animation: ${dash} 1.5s ease-in-out infinite;
|
|
83
|
+
}
|
|
84
|
+
${colorsToCss()}
|
|
85
|
+
`;
|
|
86
|
+
|
|
23
87
|
return svg(
|
|
24
88
|
{
|
|
25
|
-
class:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
89
|
+
class: {
|
|
90
|
+
deps: [visibility],
|
|
91
|
+
renderProp: () => (visibility) =>
|
|
92
|
+
classNames(
|
|
93
|
+
"spinner",
|
|
94
|
+
className,
|
|
95
|
+
color,
|
|
96
|
+
variant,
|
|
97
|
+
visibility == false ? "" : "visibility",
|
|
98
|
+
options?.class,
|
|
99
|
+
otherProps.class
|
|
100
|
+
),
|
|
101
|
+
},
|
|
33
102
|
version: "1.1",
|
|
34
|
-
id: "L6",
|
|
35
103
|
x: "0px",
|
|
36
104
|
y: "0px",
|
|
37
105
|
width: sizeToPixel[size],
|
|
38
106
|
height: sizeToPixel[size],
|
|
39
|
-
viewBox: `0 0
|
|
40
|
-
enableBackground: `new 0 0
|
|
107
|
+
viewBox: `0 0 50 50`,
|
|
108
|
+
enableBackground: `new 0 0 50 50`,
|
|
109
|
+
...otherProps,
|
|
41
110
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
height: "50",
|
|
51
|
-
},
|
|
52
|
-
animateTransform({
|
|
53
|
-
attributeName: "transform",
|
|
54
|
-
dur: "0.4s",
|
|
55
|
-
from: "0 50 50",
|
|
56
|
-
to: "180 50 50",
|
|
57
|
-
type: "rotate",
|
|
58
|
-
id: "strokeBox",
|
|
59
|
-
attributeType: "XML",
|
|
60
|
-
begin: "rectBox.end",
|
|
61
|
-
})
|
|
62
|
-
),
|
|
63
|
-
rect(
|
|
64
|
-
{ x: "27", y: "27", fill: "currentColor", width: "46", height: "50" },
|
|
65
|
-
animate({
|
|
66
|
-
attributeName: "height",
|
|
67
|
-
dur: "1.3s",
|
|
68
|
-
attributeType: "XML",
|
|
69
|
-
from: "50",
|
|
70
|
-
to: "0",
|
|
71
|
-
id: "rectBox",
|
|
72
|
-
fill: "freeze",
|
|
73
|
-
begin: "0s;strokeBox.end",
|
|
74
|
-
})
|
|
75
|
-
)
|
|
111
|
+
circle({
|
|
112
|
+
class: "path",
|
|
113
|
+
cx: "25",
|
|
114
|
+
cy: "25",
|
|
115
|
+
r: "20",
|
|
116
|
+
fill: "none",
|
|
117
|
+
"stroke-width": "5",
|
|
118
|
+
})
|
|
76
119
|
);
|
|
77
120
|
};
|
|
78
121
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/stepper" {
|
|
2
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
3
|
+
|
|
4
|
+
type StepperPagePropBase = {
|
|
5
|
+
name: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
enter?: Function;
|
|
8
|
+
exit?: Function;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type ComponentStepper =
|
|
12
|
+
import("../bau-ui").ComponentWithProp<StepperPagePropBase>;
|
|
13
|
+
|
|
14
|
+
export type StepperPage = {
|
|
15
|
+
Header: ComponentStepper;
|
|
16
|
+
Content: ComponentStepper;
|
|
17
|
+
} & StepperPagePropBase;
|
|
18
|
+
|
|
19
|
+
export type StepperProps = {
|
|
20
|
+
stepperDefs: StepperPage[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type Component = import("../bau-ui").Component<StepperProps>;
|
|
24
|
+
|
|
25
|
+
type Option = {} & ComponentOption;
|
|
26
|
+
|
|
27
|
+
export default function (context: any, option?: Option): Component;
|
|
28
|
+
}
|
package/stepper/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./stepper";
|