@plumile/ui 0.1.55 → 0.1.56
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/lib/atomic/atoms/button/Button.d.ts.map +1 -1
- package/lib/atomic/atoms/button/Button.js +5 -2
- package/lib/atomic/atoms/formatted-date/FormattedDate.d.ts +14 -0
- package/lib/atomic/atoms/formatted-date/FormattedDate.d.ts.map +1 -0
- package/lib/atomic/atoms/formatted-date/FormattedDate.js +29 -0
- package/lib/atomic/atoms/icon-button/IconMenuButton.d.ts +8 -0
- package/lib/atomic/atoms/icon-button/IconMenuButton.d.ts.map +1 -0
- package/lib/atomic/atoms/icon-button/IconMenuButton.js +10 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.d.ts +14 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.d.ts.map +1 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.js +16 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.d.ts +13 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.d.ts.map +1 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.js +42 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.d.ts +13 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.d.ts.map +1 -0
- package/lib/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.js +37 -0
- package/lib/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.d.ts +25 -0
- package/lib/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.d.ts.map +1 -0
- package/lib/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.js +221 -0
- package/lib/atomic/molecules/breadcrumb_navigation/types.d.ts +15 -0
- package/lib/atomic/molecules/breadcrumb_navigation/types.d.ts.map +1 -0
- package/lib/atomic/molecules/breadcrumb_navigation/types.js +2 -0
- package/lib/atomic/molecules/dropdown/Dropdown.d.ts +26 -0
- package/lib/atomic/molecules/dropdown/Dropdown.d.ts.map +1 -0
- package/lib/atomic/molecules/dropdown/Dropdown.js +271 -0
- package/lib/atomic/molecules/dropdown/dropdown.css.d.ts +8 -0
- package/lib/atomic/molecules/dropdown/dropdown.css.d.ts.map +1 -0
- package/lib/atomic/molecules/dropdown/dropdown.css.js +30 -0
- package/lib/atomic/molecules/form-actions/FormActions.d.ts +16 -0
- package/lib/atomic/molecules/form-actions/FormActions.d.ts.map +1 -0
- package/lib/atomic/molecules/form-actions/FormActions.js +27 -0
- package/lib/atomic/molecules/toast/ToastProvider.d.ts +19 -0
- package/lib/atomic/molecules/toast/ToastProvider.d.ts.map +1 -0
- package/lib/atomic/molecules/toast/ToastProvider.js +113 -0
- package/lib/atomic/molecules/toast/ToastViewport.d.ts +24 -0
- package/lib/atomic/molecules/toast/ToastViewport.d.ts.map +1 -0
- package/lib/atomic/molecules/toast/ToastViewport.js +40 -0
- package/lib/atomic/molecules/toast/constants.d.ts +2 -0
- package/lib/atomic/molecules/toast/constants.d.ts.map +1 -0
- package/lib/atomic/molecules/toast/constants.js +2 -0
- package/lib/atomic/molecules/toast/toast.css.d.ts +25 -0
- package/lib/atomic/molecules/toast/toast.css.d.ts.map +1 -0
- package/lib/atomic/molecules/toast/toast.css.js +106 -0
- package/lib/components/data-table/DataTable.css.d.ts +61 -0
- package/lib/components/data-table/DataTable.css.d.ts.map +1 -0
- package/lib/components/data-table/DataTable.css.js +285 -0
- package/lib/components/data-table/DataTable.d.ts +32 -0
- package/lib/components/data-table/DataTable.d.ts.map +1 -0
- package/lib/components/data-table/DataTable.js +95 -0
- package/lib/components/data-table/TableCell.css.d.ts +26 -0
- package/lib/components/data-table/TableCell.css.d.ts.map +1 -0
- package/lib/components/data-table/TableCell.css.js +45 -0
- package/lib/components/data-table/TableCell.d.ts +46 -0
- package/lib/components/data-table/TableCell.d.ts.map +1 -0
- package/lib/components/data-table/TableCell.js +72 -0
- package/lib/components/data-table/TableCellBase.d.ts +13 -0
- package/lib/components/data-table/TableCellBase.d.ts.map +1 -0
- package/lib/components/data-table/TableCellBase.js +11 -0
- package/lib/components/data-table/VirtualizedConnectionTable.css.d.ts +5 -0
- package/lib/components/data-table/VirtualizedConnectionTable.css.d.ts.map +1 -0
- package/lib/components/data-table/VirtualizedConnectionTable.css.js +18 -0
- package/lib/components/data-table/VirtualizedConnectionTable.d.ts +32 -0
- package/lib/components/data-table/VirtualizedConnectionTable.d.ts.map +1 -0
- package/lib/components/data-table/VirtualizedConnectionTable.js +304 -0
- package/lib/components/data-table/tableBreakpoints.d.ts +9 -0
- package/lib/components/data-table/tableBreakpoints.d.ts.map +1 -0
- package/lib/components/data-table/tableBreakpoints.js +34 -0
- package/lib/components/select/SimpleSelect.css.d.ts +23 -0
- package/lib/components/select/SimpleSelect.css.d.ts.map +1 -0
- package/lib/components/select/SimpleSelect.css.js +175 -0
- package/lib/components/select/SimpleSelect.d.ts +22 -0
- package/lib/components/select/SimpleSelect.d.ts.map +1 -0
- package/lib/components/select/SimpleSelect.js +218 -0
- package/lib/components/subscriptions/RefetchNeededBanner.css.d.ts +5 -0
- package/lib/components/subscriptions/RefetchNeededBanner.css.d.ts.map +1 -0
- package/lib/components/subscriptions/RefetchNeededBanner.css.js +32 -0
- package/lib/components/subscriptions/RefetchNeededBanner.d.ts +9 -0
- package/lib/components/subscriptions/RefetchNeededBanner.d.ts.map +1 -0
- package/lib/components/subscriptions/RefetchNeededBanner.js +17 -0
- package/lib/esm/atomic/atoms/button/Button.js +35 -33
- package/lib/esm/atomic/atoms/button/Button.js.map +1 -1
- package/lib/esm/atomic/atoms/formatted-date/FormattedDate.js +32 -0
- package/lib/esm/atomic/atoms/formatted-date/FormattedDate.js.map +1 -0
- package/lib/esm/atomic/atoms/icon-button/IconMenuButton.js +26 -0
- package/lib/esm/atomic/atoms/icon-button/IconMenuButton.js.map +1 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.js +55 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.js.map +1 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.js +61 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.js.map +1 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.js +64 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.js.map +1 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.js +30 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.js.map +1 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.ts.vanilla-Bhz61Foa.css +1 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/types.js +2 -0
- package/lib/esm/atomic/molecules/breadcrumb_navigation/types.js.map +1 -0
- package/lib/esm/atomic/molecules/dropdown/Dropdown.js +178 -0
- package/lib/esm/atomic/molecules/dropdown/Dropdown.js.map +1 -0
- package/lib/esm/atomic/molecules/dropdown/dropdown.css.js +13 -0
- package/lib/esm/atomic/molecules/dropdown/dropdown.css.js.map +1 -0
- package/lib/esm/atomic/molecules/form-actions/FormActions.js +57 -0
- package/lib/esm/atomic/molecules/form-actions/FormActions.js.map +1 -0
- package/lib/esm/atomic/molecules/toast/ToastProvider.js +78 -0
- package/lib/esm/atomic/molecules/toast/ToastProvider.js.map +1 -0
- package/lib/esm/atomic/molecules/toast/ToastViewport.js +71 -0
- package/lib/esm/atomic/molecules/toast/ToastViewport.js.map +1 -0
- package/lib/esm/atomic/molecules/toast/constants.js +5 -0
- package/lib/esm/atomic/molecules/toast/constants.js.map +1 -0
- package/lib/esm/atomic/molecules/toast/toast.css.js +17 -0
- package/lib/esm/atomic/molecules/toast/toast.css.js.map +1 -0
- package/lib/esm/atomic/molecules/toast/toast.css.ts.vanilla-2GtcGJsi.css +1 -0
- package/lib/esm/components/data-table/DataTable.css.js +24 -0
- package/lib/esm/components/data-table/DataTable.css.js.map +1 -0
- package/lib/esm/components/data-table/DataTable.css.ts.vanilla-BLE98fwj.css +1 -0
- package/lib/esm/components/data-table/DataTable.js +141 -0
- package/lib/esm/components/data-table/DataTable.js.map +1 -0
- package/lib/esm/components/data-table/TableCell.css.js +15 -0
- package/lib/esm/components/data-table/TableCell.css.js.map +1 -0
- package/lib/esm/components/data-table/TableCell.css.ts.vanilla-i5QJvdbl.css +1 -0
- package/lib/esm/components/data-table/TableCell.js +74 -0
- package/lib/esm/components/data-table/TableCell.js.map +1 -0
- package/lib/esm/components/data-table/TableCellBase.js +16 -0
- package/lib/esm/components/data-table/TableCellBase.js.map +1 -0
- package/lib/esm/components/data-table/VirtualizedConnectionTable.css.js +10 -0
- package/lib/esm/components/data-table/VirtualizedConnectionTable.css.js.map +1 -0
- package/lib/esm/components/data-table/VirtualizedConnectionTable.js +249 -0
- package/lib/esm/components/data-table/VirtualizedConnectionTable.js.map +1 -0
- package/lib/esm/components/data-table/tableBreakpoints.js +37 -0
- package/lib/esm/components/data-table/tableBreakpoints.js.map +1 -0
- package/lib/esm/components/select/SimpleSelect.css.js +22 -0
- package/lib/esm/components/select/SimpleSelect.css.js.map +1 -0
- package/lib/esm/components/select/SimpleSelect.css.ts.vanilla-Bil1v8q6.css +1 -0
- package/lib/esm/components/select/SimpleSelect.js +185 -0
- package/lib/esm/components/select/SimpleSelect.js.map +1 -0
- package/lib/esm/components/subscriptions/RefetchNeededBanner.css.js +10 -0
- package/lib/esm/components/subscriptions/RefetchNeededBanner.css.js.map +1 -0
- package/lib/esm/components/subscriptions/RefetchNeededBanner.js +24 -0
- package/lib/esm/components/subscriptions/RefetchNeededBanner.js.map +1 -0
- package/lib/esm/i18n/useUiTranslation.js +8 -0
- package/lib/esm/i18n/useUiTranslation.js.map +1 -0
- package/lib/esm/index.js +68 -47
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/styles/slots.js +2 -0
- package/lib/esm/styles/slots.js.map +1 -0
- package/lib/i18n/useUiTranslation.d.ts +3 -0
- package/lib/i18n/useUiTranslation.d.ts.map +1 -0
- package/lib/i18n/useUiTranslation.js +5 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -1
- package/lib/styles/slots.d.ts +2 -0
- package/lib/styles/slots.d.ts.map +1 -0
- package/lib/styles/slots.js +2 -0
- package/lib/types/atomic/atoms/button/Button.d.ts.map +1 -1
- package/lib/types/atomic/atoms/formatted-date/FormattedDate.d.ts +14 -0
- package/lib/types/atomic/atoms/formatted-date/FormattedDate.d.ts.map +1 -0
- package/lib/types/atomic/atoms/icon-button/IconMenuButton.d.ts +8 -0
- package/lib/types/atomic/atoms/icon-button/IconMenuButton.d.ts.map +1 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.d.ts +14 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.d.ts.map +1 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.d.ts +13 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.d.ts.map +1 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.d.ts +13 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.d.ts.map +1 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.d.ts +25 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.d.ts.map +1 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/types.d.ts +15 -0
- package/lib/types/atomic/molecules/breadcrumb_navigation/types.d.ts.map +1 -0
- package/lib/types/atomic/molecules/dropdown/Dropdown.d.ts +26 -0
- package/lib/types/atomic/molecules/dropdown/Dropdown.d.ts.map +1 -0
- package/lib/types/atomic/molecules/dropdown/dropdown.css.d.ts +8 -0
- package/lib/types/atomic/molecules/dropdown/dropdown.css.d.ts.map +1 -0
- package/lib/types/atomic/molecules/form-actions/FormActions.d.ts +16 -0
- package/lib/types/atomic/molecules/form-actions/FormActions.d.ts.map +1 -0
- package/lib/types/atomic/molecules/toast/ToastProvider.d.ts +19 -0
- package/lib/types/atomic/molecules/toast/ToastProvider.d.ts.map +1 -0
- package/lib/types/atomic/molecules/toast/ToastViewport.d.ts +24 -0
- package/lib/types/atomic/molecules/toast/ToastViewport.d.ts.map +1 -0
- package/lib/types/atomic/molecules/toast/constants.d.ts +2 -0
- package/lib/types/atomic/molecules/toast/constants.d.ts.map +1 -0
- package/lib/types/atomic/molecules/toast/toast.css.d.ts +25 -0
- package/lib/types/atomic/molecules/toast/toast.css.d.ts.map +1 -0
- package/lib/types/components/data-table/DataTable.css.d.ts +61 -0
- package/lib/types/components/data-table/DataTable.css.d.ts.map +1 -0
- package/lib/types/components/data-table/DataTable.d.ts +32 -0
- package/lib/types/components/data-table/DataTable.d.ts.map +1 -0
- package/lib/types/components/data-table/TableCell.css.d.ts +26 -0
- package/lib/types/components/data-table/TableCell.css.d.ts.map +1 -0
- package/lib/types/components/data-table/TableCell.d.ts +46 -0
- package/lib/types/components/data-table/TableCell.d.ts.map +1 -0
- package/lib/types/components/data-table/TableCellBase.d.ts +13 -0
- package/lib/types/components/data-table/TableCellBase.d.ts.map +1 -0
- package/lib/types/components/data-table/VirtualizedConnectionTable.css.d.ts +5 -0
- package/lib/types/components/data-table/VirtualizedConnectionTable.css.d.ts.map +1 -0
- package/lib/types/components/data-table/VirtualizedConnectionTable.d.ts +32 -0
- package/lib/types/components/data-table/VirtualizedConnectionTable.d.ts.map +1 -0
- package/lib/types/components/data-table/tableBreakpoints.d.ts +9 -0
- package/lib/types/components/data-table/tableBreakpoints.d.ts.map +1 -0
- package/lib/types/components/select/SimpleSelect.css.d.ts +23 -0
- package/lib/types/components/select/SimpleSelect.css.d.ts.map +1 -0
- package/lib/types/components/select/SimpleSelect.d.ts +22 -0
- package/lib/types/components/select/SimpleSelect.d.ts.map +1 -0
- package/lib/types/components/subscriptions/RefetchNeededBanner.css.d.ts +5 -0
- package/lib/types/components/subscriptions/RefetchNeededBanner.css.d.ts.map +1 -0
- package/lib/types/components/subscriptions/RefetchNeededBanner.d.ts +9 -0
- package/lib/types/components/subscriptions/RefetchNeededBanner.d.ts.map +1 -0
- package/lib/types/i18n/useUiTranslation.d.ts +3 -0
- package/lib/types/i18n/useUiTranslation.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/styles/slots.d.ts +2 -0
- package/lib/types/styles/slots.d.ts.map +1 -0
- package/package.json +10 -3
- package/src/i18n/locales/en/ui.json +53 -0
- package/src/i18n/locales/fr/ui.json +53 -0
- package/src/i18n/useUiTranslation.ts +6 -0
- /package/lib/esm/components/layout/{TabsContentLayout.css.ts.vanilla-tn0RQdqM.css → ContentLayout.css.ts.vanilla-tn0RQdqM.css} +0 -0
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as v, jsx as o, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { ButtonLoadingSpinnerSvg as B } from "../../../icons/ButtonLoadingSpinnerSvg.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useUiTranslation as j } from "../../../i18n/useUiTranslation.js";
|
|
4
|
+
import { button as w, spinnerIcon as C, loadingIndicator as R, iconLeft as S, content as z, iconRight as D } from "./button.css.js";
|
|
4
5
|
import { cx as e } from "../../../theme/tools.js";
|
|
5
|
-
const
|
|
6
|
-
const {
|
|
7
|
-
children:
|
|
8
|
-
className:
|
|
9
|
-
disabled:
|
|
6
|
+
const q = (l) => {
|
|
7
|
+
const { t: r } = j(), {
|
|
8
|
+
children: d,
|
|
9
|
+
className: m,
|
|
10
|
+
disabled: h,
|
|
10
11
|
isLoading: i = !1,
|
|
11
|
-
loadingLabel:
|
|
12
|
+
loadingLabel: p,
|
|
12
13
|
classes: s,
|
|
13
14
|
leftIcon: a,
|
|
14
15
|
rightIcon: c,
|
|
15
|
-
size:
|
|
16
|
-
variant:
|
|
17
|
-
width:
|
|
18
|
-
ref:
|
|
19
|
-
...
|
|
20
|
-
} = l,
|
|
16
|
+
size: f,
|
|
17
|
+
variant: g,
|
|
18
|
+
width: u,
|
|
19
|
+
ref: N,
|
|
20
|
+
...b
|
|
21
|
+
} = l, L = e(w({ variant: g, size: f, width: u }), m), I = !!i || !!h;
|
|
21
22
|
let t;
|
|
22
|
-
if (i)
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (i) {
|
|
24
|
+
const n = p ?? r("common.loading");
|
|
25
|
+
t = /* @__PURE__ */ v("span", { className: e(R, s?.loadingIndicator), children: [
|
|
26
|
+
/* @__PURE__ */ o(
|
|
25
27
|
B,
|
|
26
28
|
{
|
|
27
|
-
className: e(
|
|
29
|
+
className: e(C, s?.spinnerIcon),
|
|
28
30
|
width: 20,
|
|
29
31
|
height: 20
|
|
30
32
|
}
|
|
31
33
|
),
|
|
32
|
-
|
|
34
|
+
n
|
|
33
35
|
] });
|
|
34
|
-
else {
|
|
35
|
-
const
|
|
36
|
-
a != null &&
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
), c != null &&
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
), t = /* @__PURE__ */
|
|
36
|
+
} else {
|
|
37
|
+
const n = [];
|
|
38
|
+
a != null && n.push(
|
|
39
|
+
/* @__PURE__ */ o("span", { className: e(S, s?.iconLeft), children: a }, "left-icon")
|
|
40
|
+
), n.push(
|
|
41
|
+
/* @__PURE__ */ o("span", { className: e(z, s?.content), children: d }, "content")
|
|
42
|
+
), c != null && n.push(
|
|
43
|
+
/* @__PURE__ */ o("span", { className: e(D, s?.iconRight), children: c }, "right-icon")
|
|
44
|
+
), t = /* @__PURE__ */ o(x, { children: n });
|
|
43
45
|
}
|
|
44
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ o(
|
|
45
47
|
"button",
|
|
46
48
|
{
|
|
47
|
-
ref:
|
|
48
|
-
className:
|
|
49
|
+
ref: N,
|
|
50
|
+
className: L,
|
|
49
51
|
disabled: I,
|
|
50
|
-
...
|
|
52
|
+
...b,
|
|
51
53
|
children: t
|
|
52
54
|
}
|
|
53
55
|
);
|
|
54
56
|
};
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
q as Button
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../src/atomic/atoms/button/Button.tsx"],"sourcesContent":["import React, { type Ref, type JSX } from 'react';\n\nimport { ButtonLoadingSpinnerSvg } from '../../../icons/ButtonLoadingSpinnerSvg.js';\n\nimport {\n button,\n content as contentClass,\n iconLeft,\n iconRight,\n loadingIndicator,\n spinnerIcon,\n type ButtonVariants,\n} from './button.css.js';\nimport { cx } from '../../../theme/tools.js';\n\ntype ButtonSlot =\n | 'loadingIndicator'\n | 'spinnerIcon'\n | 'content'\n | 'iconLeft'\n | 'iconRight';\n\ntype SlotClasses<T extends string> = Partial<Record<T, string>>;\n\n// Omit the conflicting 'size' property from HTML button attributes\ntype Props = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size'> & {\n variant?: NonNullable<ButtonVariants>['variant'];\n size?: NonNullable<ButtonVariants>['size'];\n width?: NonNullable<ButtonVariants>['width'];\n isLoading?: boolean;\n loadingLabel?: React.ReactNode;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n ref?: Ref<HTMLButtonElement>;\n classes?: SlotClasses<ButtonSlot>;\n};\n\nexport const Button = (props: Props): JSX.Element => {\n const {\n children,\n className,\n disabled,\n isLoading = false,\n loadingLabel,\n classes,\n leftIcon,\n rightIcon,\n size,\n variant,\n width,\n ref,\n ...rest\n } = props;\n\n const resolvedClassName = cx(button({ variant, size, width }), className);\n const isDisabled = Boolean(isLoading) || Boolean(disabled);\n\n let renderedContent: JSX.Element;\n\n if (isLoading) {\n renderedContent = (\n <span className={cx(loadingIndicator, classes?.loadingIndicator)}>\n <ButtonLoadingSpinnerSvg\n className={cx(spinnerIcon, classes?.spinnerIcon)}\n width={20}\n height={20}\n />\n {
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../src/atomic/atoms/button/Button.tsx"],"sourcesContent":["import React, { type Ref, type JSX } from 'react';\n\nimport { ButtonLoadingSpinnerSvg } from '../../../icons/ButtonLoadingSpinnerSvg.js';\nimport { useUiTranslation } from '../../../i18n/useUiTranslation.js';\n\nimport {\n button,\n content as contentClass,\n iconLeft,\n iconRight,\n loadingIndicator,\n spinnerIcon,\n type ButtonVariants,\n} from './button.css.js';\nimport { cx } from '../../../theme/tools.js';\n\ntype ButtonSlot =\n | 'loadingIndicator'\n | 'spinnerIcon'\n | 'content'\n | 'iconLeft'\n | 'iconRight';\n\ntype SlotClasses<T extends string> = Partial<Record<T, string>>;\n\n// Omit the conflicting 'size' property from HTML button attributes\ntype Props = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size'> & {\n variant?: NonNullable<ButtonVariants>['variant'];\n size?: NonNullable<ButtonVariants>['size'];\n width?: NonNullable<ButtonVariants>['width'];\n isLoading?: boolean;\n loadingLabel?: React.ReactNode;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n ref?: Ref<HTMLButtonElement>;\n classes?: SlotClasses<ButtonSlot>;\n};\n\nexport const Button = (props: Props): JSX.Element => {\n const { t } = useUiTranslation();\n const {\n children,\n className,\n disabled,\n isLoading = false,\n loadingLabel,\n classes,\n leftIcon,\n rightIcon,\n size,\n variant,\n width,\n ref,\n ...rest\n } = props;\n\n const resolvedClassName = cx(button({ variant, size, width }), className);\n const isDisabled = Boolean(isLoading) || Boolean(disabled);\n\n let renderedContent: JSX.Element;\n\n if (isLoading) {\n const resolvedLoadingLabel = loadingLabel ?? t('common.loading');\n renderedContent = (\n <span className={cx(loadingIndicator, classes?.loadingIndicator)}>\n <ButtonLoadingSpinnerSvg\n className={cx(spinnerIcon, classes?.spinnerIcon)}\n width={20}\n height={20}\n />\n {resolvedLoadingLabel}\n </span>\n );\n } else {\n const iconElements: JSX.Element[] = [];\n\n if (leftIcon != null) {\n iconElements.push(\n <span className={cx(iconLeft, classes?.iconLeft)} key=\"left-icon\">\n {leftIcon}\n </span>,\n );\n }\n\n iconElements.push(\n <span className={cx(contentClass, classes?.content)} key=\"content\">\n {children}\n </span>,\n );\n\n if (rightIcon != null) {\n iconElements.push(\n <span className={cx(iconRight, classes?.iconRight)} key=\"right-icon\">\n {rightIcon}\n </span>,\n );\n }\n\n renderedContent = <>{iconElements}</>;\n }\n\n return (\n <button\n ref={ref}\n className={resolvedClassName}\n disabled={isDisabled}\n {...rest}\n >\n {renderedContent}\n </button>\n );\n};\n"],"names":["Button","props","t","useUiTranslation","children","className","disabled","isLoading","loadingLabel","classes","leftIcon","rightIcon","size","variant","width","ref","rest","resolvedClassName","cx","button","isDisabled","renderedContent","resolvedLoadingLabel","loadingIndicator","jsx","ButtonLoadingSpinnerSvg","spinnerIcon","iconElements","iconLeft","contentClass","iconRight"],"mappings":";;;;;AAsCO,MAAMA,IAAS,CAACC,MAA8B;AACnD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR;AAAA,IACJ,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDf,GAEEgB,IAAoBC,EAAGC,EAAO,EAAE,SAAAN,GAAS,MAAAD,GAAM,OAAAE,GAAO,GAAGT,CAAS,GAClEe,IAAa,EAAQb,KAAc,EAAQD;AAEjD,MAAIe;AAEJ,MAAId,GAAW;AACb,UAAMe,IAAuBd,KAAgBN,EAAE,gBAAgB;AAC/D,IAAAmB,sBACG,QAAA,EAAK,WAAWH,EAAGK,GAAkBd,GAAS,gBAAgB,GAC7D,UAAA;AAAA,MAAA,gBAAAe;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAWP,EAAGQ,GAAajB,GAAS,WAAW;AAAA,UAC/C,OAAO;AAAA,UACP,QAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,MAETa;AAAA,IAAA,GACH;AAAA,EAEJ,OAAO;AACL,UAAMK,IAA8B,CAAA;AAEpC,IAAIjB,KAAY,QACdiB,EAAa;AAAA,MACX,gBAAAH,EAAC,UAAK,WAAWN,EAAGU,GAAUnB,GAAS,QAAQ,GAC5C,UAAAC,EAAA,GADmD,WAEtD;AAAA,IAAA,GAIJiB,EAAa;AAAA,MACX,gBAAAH,EAAC,UAAK,WAAWN,EAAGW,GAAcpB,GAAS,OAAO,GAC/C,UAAAL,EAAA,GADsD,SAEzD;AAAA,IAAA,GAGEO,KAAa,QACfgB,EAAa;AAAA,MACX,gBAAAH,EAAC,UAAK,WAAWN,EAAGY,GAAWrB,GAAS,SAAS,GAC9C,UAAAE,EAAA,GADqD,YAExD;AAAA,IAAA,GAIJU,2BAAqB,UAAAM,EAAA,CAAa;AAAA,EACpC;AAEA,SACE,gBAAAH;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAT;AAAA,MACA,WAAWE;AAAA,MACX,UAAUG;AAAA,MACT,GAAGJ;AAAA,MAEH,UAAAK;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
3
|
+
import { useUiTranslation as l } from "../../../i18n/useUiTranslation.js";
|
|
4
|
+
const d = {
|
|
5
|
+
year: "numeric",
|
|
6
|
+
month: "short",
|
|
7
|
+
day: "numeric"
|
|
8
|
+
}, h = ({
|
|
9
|
+
value: r,
|
|
10
|
+
fallback: m,
|
|
11
|
+
options: e = d,
|
|
12
|
+
locale: n,
|
|
13
|
+
className: a
|
|
14
|
+
}) => {
|
|
15
|
+
const { t: i } = l(), t = m ?? i("common.notAvailable"), s = u(() => {
|
|
16
|
+
if (r == null)
|
|
17
|
+
return t;
|
|
18
|
+
const o = new Date(String(r));
|
|
19
|
+
if (Number.isNaN(o.getTime()))
|
|
20
|
+
return t;
|
|
21
|
+
try {
|
|
22
|
+
return new Intl.DateTimeFormat(n, e).format(o);
|
|
23
|
+
} catch {
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
}, [r, t, n, e]);
|
|
27
|
+
return /* @__PURE__ */ c("span", { className: a, children: s });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
h as FormattedDate
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=FormattedDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormattedDate.js","sources":["../../../../../src/atomic/atoms/formatted-date/FormattedDate.tsx"],"sourcesContent":["import { type JSX, useMemo } from 'react';\nimport { useUiTranslation } from '../../../i18n/useUiTranslation.js';\n\ntype DateValue = string | { toString: () => string };\n\ntype Props = {\n value: DateValue | null | undefined;\n fallback?: string;\n options?: Intl.DateTimeFormatOptions;\n locale?: string;\n className?: string;\n};\n\nconst DEFAULT_OPTIONS: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n};\n\nexport const FormattedDate = ({\n value,\n fallback,\n options = DEFAULT_OPTIONS,\n locale,\n className,\n}: Props): JSX.Element => {\n const { t } = useUiTranslation();\n const resolvedFallback = fallback ?? t('common.notAvailable');\n const displayValue = useMemo(() => {\n if (value == null) {\n return resolvedFallback;\n }\n\n const date = new Date(String(value));\n if (Number.isNaN(date.getTime())) {\n return resolvedFallback;\n }\n\n try {\n return new Intl.DateTimeFormat(locale, options).format(date);\n } catch {\n return resolvedFallback;\n }\n }, [value, resolvedFallback, locale, options]);\n\n return <span className={className}>{displayValue}</span>;\n};\n"],"names":["DEFAULT_OPTIONS","FormattedDate","value","fallback","options","locale","className","t","useUiTranslation","resolvedFallback","displayValue","useMemo","date","jsx"],"mappings":";;;AAaA,MAAMA,IAA8C;AAAA,EAClD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AACP,GAEaC,IAAgB,CAAC;AAAA,EAC5B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAUJ;AAAA,EACV,QAAAK;AAAA,EACA,WAAAC;AACF,MAA0B;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAmBN,KAAYI,EAAE,qBAAqB,GACtDG,IAAeC,EAAQ,MAAM;AACjC,QAAIT,KAAS;AACX,aAAOO;AAGT,UAAMG,IAAO,IAAI,KAAK,OAAOV,CAAK,CAAC;AACnC,QAAI,OAAO,MAAMU,EAAK,QAAA,CAAS;AAC7B,aAAOH;AAGT,QAAI;AACF,aAAO,IAAI,KAAK,eAAeJ,GAAQD,CAAO,EAAE,OAAOQ,CAAI;AAAA,IAC7D,QAAQ;AACN,aAAOH;AAAA,IACT;AAAA,EACF,GAAG,CAACP,GAAOO,GAAkBJ,GAAQD,CAAO,CAAC;AAE7C,SAAO,gBAAAS,EAAC,QAAA,EAAK,WAAAP,GAAuB,UAAAI,EAAA,CAAa;AACnD;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Button as a } from "../button/Button.js";
|
|
3
|
+
import { useUiTranslation as i } from "../../../i18n/useUiTranslation.js";
|
|
4
|
+
const l = "⋮", b = ({
|
|
5
|
+
label: o,
|
|
6
|
+
icon: t = l,
|
|
7
|
+
type: n = "button",
|
|
8
|
+
...r
|
|
9
|
+
}) => {
|
|
10
|
+
const { t: e } = i(), m = o ?? e("common.menu.open");
|
|
11
|
+
return /* @__PURE__ */ s(
|
|
12
|
+
a,
|
|
13
|
+
{
|
|
14
|
+
"aria-label": m,
|
|
15
|
+
variant: "text",
|
|
16
|
+
size: "small",
|
|
17
|
+
type: n,
|
|
18
|
+
...r,
|
|
19
|
+
children: t
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
b as IconMenuButton
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=IconMenuButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconMenuButton.js","sources":["../../../../../src/atomic/atoms/icon-button/IconMenuButton.tsx"],"sourcesContent":["import { type ComponentProps, type JSX } from 'react';\n\nimport { Button } from '../button/Button.js';\nimport { useUiTranslation } from '../../../i18n/useUiTranslation.js';\n\nconst DEFAULT_ICON = '⋮';\n\nexport type IconMenuButtonProps = Omit<\n ComponentProps<typeof Button>,\n 'children' | 'variant' | 'size'\n> & {\n label?: string;\n icon?: JSX.Element | string;\n};\n\nexport const IconMenuButton = ({\n label,\n icon = DEFAULT_ICON,\n type = 'button',\n ...rest\n}: IconMenuButtonProps): JSX.Element => {\n const { t } = useUiTranslation();\n const resolvedLabel = label ?? t('common.menu.open');\n return (\n <Button\n aria-label={resolvedLabel}\n variant=\"text\"\n size=\"small\"\n type={type}\n {...rest}\n >\n {icon}\n </Button>\n );\n};\n"],"names":["DEFAULT_ICON","IconMenuButton","label","icon","type","rest","t","useUiTranslation","resolvedLabel","jsx","Button"],"mappings":";;;AAKA,MAAMA,IAAe,KAURC,IAAiB,CAAC;AAAA,EAC7B,OAAAC;AAAA,EACA,MAAAC,IAAOH;AAAA,EACP,MAAAI,IAAO;AAAA,EACP,GAAGC;AACL,MAAwC;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAgBN,KAASI,EAAE,kBAAkB;AACnD,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,cAAYF;AAAA,MACZ,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,MAAAJ;AAAA,MACC,GAAGC;AAAA,MAEH,UAAAF;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Link as b } from "@plumile/router";
|
|
3
|
+
import { ChevronDownSvg as l } from "../../../icons/ChevronDownSvg.js";
|
|
4
|
+
import { Dropdown as p } from "../dropdown/Dropdown.js";
|
|
5
|
+
import { cx as u } from "../../../theme/tools.js";
|
|
6
|
+
import { breadcrumbSection as h, breadcrumbNameRow as v, breadcrumbLink as f, popoverPanel as N, breadcrumbChevronButton as g, breadcrumbChevronOpen as w, breadcrumbChevron as C } from "./breadcrumbNavigation.css.js";
|
|
7
|
+
import { BreadcrumbMenuPopover as x } from "./BreadcrumbMenuPopover.js";
|
|
8
|
+
const P = ({
|
|
9
|
+
node: e,
|
|
10
|
+
menu: o,
|
|
11
|
+
ariaLabel: t,
|
|
12
|
+
searchPlaceholder: m,
|
|
13
|
+
searchAriaLabel: n,
|
|
14
|
+
emptyLabel: a,
|
|
15
|
+
emptyMatchesLabel: c
|
|
16
|
+
}) => {
|
|
17
|
+
const i = o?.items ?? [];
|
|
18
|
+
return /* @__PURE__ */ r("div", { className: h, children: /* @__PURE__ */ d("div", { className: v, children: [
|
|
19
|
+
/* @__PURE__ */ r(b, { to: e.to, className: f, children: e.name }),
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
|
+
p,
|
|
22
|
+
{
|
|
23
|
+
trigger: (s) => /* @__PURE__ */ r("button", { type: "button", className: g, children: /* @__PURE__ */ r(
|
|
24
|
+
l,
|
|
25
|
+
{
|
|
26
|
+
width: 14,
|
|
27
|
+
height: 14,
|
|
28
|
+
className: u(C, {
|
|
29
|
+
[w]: s
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
) }),
|
|
33
|
+
ariaLabel: t,
|
|
34
|
+
placement: "bottom-start",
|
|
35
|
+
matchTriggerWidth: !1,
|
|
36
|
+
contentClassName: N,
|
|
37
|
+
children: /* @__PURE__ */ r(
|
|
38
|
+
x,
|
|
39
|
+
{
|
|
40
|
+
items: i,
|
|
41
|
+
selectedId: o?.selectedId,
|
|
42
|
+
searchPlaceholder: m,
|
|
43
|
+
searchAriaLabel: n,
|
|
44
|
+
emptyLabel: a,
|
|
45
|
+
emptyMatchesLabel: c
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] }) });
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
P as BreadcrumbMenuDropdown
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=BreadcrumbMenuDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbMenuDropdown.js","sources":["../../../../../src/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuDropdown.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport { Link } from '@plumile/router';\nimport { ChevronDownSvg } from '../../../icons/ChevronDownSvg.js';\nimport { Dropdown } from '../dropdown/Dropdown.js';\nimport { cx } from '../../../theme/tools.js';\n\nimport * as styles from './breadcrumbNavigation.css.js';\nimport { BreadcrumbMenuPopover } from './BreadcrumbMenuPopover.js';\nimport type { BreadcrumbMenuConfig, BreadcrumbNode } from './types.js';\n\ntype Props = {\n node: BreadcrumbNode;\n menu?: BreadcrumbMenuConfig;\n ariaLabel: string;\n searchPlaceholder: string;\n searchAriaLabel: string;\n emptyLabel: string;\n emptyMatchesLabel: string;\n};\n\nexport const BreadcrumbMenuDropdown = ({\n node,\n menu,\n ariaLabel,\n searchPlaceholder,\n searchAriaLabel,\n emptyLabel,\n emptyMatchesLabel,\n}: Props): JSX.Element => {\n const menuItems = menu?.items ?? [];\n\n return (\n <div className={styles.breadcrumbSection}>\n {/* <span className={styles.breadcrumbLabel}>{sectionLabel}</span> */}\n <div className={styles.breadcrumbNameRow}>\n <Link to={node.to} className={styles.breadcrumbLink}>\n {node.name}\n </Link>\n <Dropdown\n trigger={(isOpen) => {\n return (\n <button type=\"button\" className={styles.breadcrumbChevronButton}>\n <ChevronDownSvg\n width={14}\n height={14}\n className={cx(styles.breadcrumbChevron, {\n [styles.breadcrumbChevronOpen]: isOpen,\n })}\n />\n </button>\n );\n }}\n ariaLabel={ariaLabel}\n placement=\"bottom-start\"\n matchTriggerWidth={false}\n contentClassName={styles.popoverPanel}\n >\n <BreadcrumbMenuPopover\n items={menuItems}\n selectedId={menu?.selectedId}\n searchPlaceholder={searchPlaceholder}\n searchAriaLabel={searchAriaLabel}\n emptyLabel={emptyLabel}\n emptyMatchesLabel={emptyMatchesLabel}\n />\n </Dropdown>\n </div>\n </div>\n );\n};\n"],"names":["BreadcrumbMenuDropdown","node","menu","ariaLabel","searchPlaceholder","searchAriaLabel","emptyLabel","emptyMatchesLabel","menuItems","jsx","styles.breadcrumbSection","jsxs","styles.breadcrumbNameRow","Link","styles.breadcrumbLink","Dropdown","isOpen","styles.breadcrumbChevronButton","ChevronDownSvg","cx","styles.breadcrumbChevron","styles.breadcrumbChevronOpen","styles.popoverPanel","BreadcrumbMenuPopover"],"mappings":";;;;;;;AAoBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AACF,MAA0B;AACxB,QAAMC,IAAYN,GAAM,SAAS,CAAA;AAEjC,SACE,gBAAAO,EAAC,SAAI,WAAWC,GAEd,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWC,GACd,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAA,EAAK,IAAIZ,EAAK,IAAI,WAAWa,GAC3B,YAAK,KAAA,CACR;AAAA,IACA,gBAAAL;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,SAAS,CAACC,wBAEL,UAAA,EAAO,MAAK,UAAS,WAAWC,GAC/B,UAAA,gBAAAR;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAWC,EAAGC,GAA0B;AAAA,cACtC,CAACC,CAA4B,GAAGL;AAAA,YAAA,CACjC;AAAA,UAAA;AAAA,QAAA,GAEL;AAAA,QAGJ,WAAAb;AAAA,QACA,WAAU;AAAA,QACV,mBAAmB;AAAA,QACnB,kBAAkBmB;AAAAA,QAElB,UAAA,gBAAAb;AAAA,UAACc;AAAA,UAAA;AAAA,YACC,OAAOf;AAAA,YACP,YAAYN,GAAM;AAAA,YAClB,mBAAAE;AAAA,YACA,iBAAAC;AAAA,YACA,YAAAC;AAAA,YACA,mBAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useMemo as y } from "react";
|
|
3
|
+
import { Link as C } from "@plumile/router";
|
|
4
|
+
import { Input as I } from "../../atoms/input/Input.js";
|
|
5
|
+
import { useDropdown as L } from "../dropdown/Dropdown.js";
|
|
6
|
+
import { cx as x } from "../../../theme/tools.js";
|
|
7
|
+
import { popoverContent as b, popoverSearch as g, popoverList as w, popoverEmpty as S, popoverItemActive as j, popoverItem as k, popoverItemDescription as z, popoverItemName as D } from "./breadcrumbNavigation.css.js";
|
|
8
|
+
const W = ({
|
|
9
|
+
items: t,
|
|
10
|
+
selectedId: p,
|
|
11
|
+
searchPlaceholder: c,
|
|
12
|
+
searchAriaLabel: m,
|
|
13
|
+
emptyLabel: d,
|
|
14
|
+
emptyMatchesLabel: u
|
|
15
|
+
}) => {
|
|
16
|
+
const { close: h } = L(), [n, v] = N(""), o = n.trim().toLowerCase(), a = y(() => o === "" ? t : t.filter((e) => e.name.toLowerCase().includes(o)), [t, o]);
|
|
17
|
+
let l;
|
|
18
|
+
return o === "" ? l = d : l = u, /* @__PURE__ */ s("div", { className: b, children: [
|
|
19
|
+
/* @__PURE__ */ r("div", { className: g, children: /* @__PURE__ */ r(
|
|
20
|
+
I,
|
|
21
|
+
{
|
|
22
|
+
type: "search",
|
|
23
|
+
size: "small",
|
|
24
|
+
fullWidth: !0,
|
|
25
|
+
placeholder: c,
|
|
26
|
+
value: n,
|
|
27
|
+
onChange: (e) => {
|
|
28
|
+
v(e.target.value);
|
|
29
|
+
},
|
|
30
|
+
"aria-label": m
|
|
31
|
+
}
|
|
32
|
+
) }),
|
|
33
|
+
/* @__PURE__ */ s("ul", { className: w, children: [
|
|
34
|
+
a.length === 0 && /* @__PURE__ */ r("li", { className: S, children: l }),
|
|
35
|
+
a.map((e) => {
|
|
36
|
+
const f = x(k, {
|
|
37
|
+
[j]: e.id === p
|
|
38
|
+
});
|
|
39
|
+
let i = null;
|
|
40
|
+
return e.description != null && e.description !== "" && (i = /* @__PURE__ */ r("span", { className: z, children: e.description })), /* @__PURE__ */ r("li", { children: /* @__PURE__ */ s(
|
|
41
|
+
C,
|
|
42
|
+
{
|
|
43
|
+
to: e.to,
|
|
44
|
+
className: f,
|
|
45
|
+
onClick: () => {
|
|
46
|
+
h();
|
|
47
|
+
},
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ r("span", { className: D, children: e.name }),
|
|
50
|
+
i
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
) }, e.id);
|
|
54
|
+
})
|
|
55
|
+
] })
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
W as BreadcrumbMenuPopover
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=BreadcrumbMenuPopover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbMenuPopover.js","sources":["../../../../../src/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.tsx"],"sourcesContent":["import { type JSX, useMemo, useState } from 'react';\nimport { Link } from '@plumile/router';\nimport { Input } from '../../atoms/input/Input.js';\nimport { useDropdown } from '../dropdown/Dropdown.js';\nimport { cx } from '../../../theme/tools.js';\n\nimport * as styles from './breadcrumbNavigation.css.js';\nimport type { BreadcrumbMenuItem } from './types.js';\n\ntype Props = {\n items: readonly BreadcrumbMenuItem[];\n selectedId?: string | null;\n searchPlaceholder: string;\n searchAriaLabel: string;\n emptyLabel: string;\n emptyMatchesLabel: string;\n};\n\nexport const BreadcrumbMenuPopover = ({\n items,\n selectedId,\n searchPlaceholder,\n searchAriaLabel,\n emptyLabel,\n emptyMatchesLabel,\n}: Props): JSX.Element => {\n const { close } = useDropdown();\n const [query, setQuery] = useState('');\n const normalizedQuery = query.trim().toLowerCase();\n\n const filteredItems = useMemo(() => {\n if (normalizedQuery === '') {\n return items;\n }\n\n return items.filter((item) => {\n return item.name.toLowerCase().includes(normalizedQuery);\n });\n }, [items, normalizedQuery]);\n\n let emptyStateLabel: string;\n if (normalizedQuery === '') {\n emptyStateLabel = emptyLabel;\n } else {\n emptyStateLabel = emptyMatchesLabel;\n }\n\n return (\n <div className={styles.popoverContent}>\n <div className={styles.popoverSearch}>\n <Input\n type=\"search\"\n size=\"small\"\n fullWidth\n placeholder={searchPlaceholder}\n value={query}\n onChange={(event) => {\n setQuery(event.target.value);\n }}\n aria-label={searchAriaLabel}\n />\n </div>\n <ul className={styles.popoverList}>\n {filteredItems.length === 0 && (\n <li className={styles.popoverEmpty}>{emptyStateLabel}</li>\n )}\n {filteredItems.map((item) => {\n const itemClassName = cx(styles.popoverItem, {\n [styles.popoverItemActive]: item.id === selectedId,\n });\n\n let descriptionNode: JSX.Element | null = null;\n if (item.description != null && item.description !== '') {\n descriptionNode = (\n <span className={styles.popoverItemDescription}>\n {item.description}\n </span>\n );\n }\n\n return (\n <li key={item.id}>\n <Link\n to={item.to}\n className={itemClassName}\n onClick={() => {\n close();\n }}\n >\n <span className={styles.popoverItemName}>{item.name}</span>\n {descriptionNode}\n </Link>\n </li>\n );\n })}\n </ul>\n </div>\n );\n};\n"],"names":["BreadcrumbMenuPopover","items","selectedId","searchPlaceholder","searchAriaLabel","emptyLabel","emptyMatchesLabel","close","useDropdown","query","setQuery","useState","normalizedQuery","filteredItems","useMemo","item","emptyStateLabel","jsxs","styles.popoverContent","jsx","styles.popoverSearch","Input","event","styles.popoverList","styles.popoverEmpty","itemClassName","cx","styles.popoverItem","styles.popoverItemActive","descriptionNode","styles.popoverItemDescription","Link","styles.popoverItemName"],"mappings":";;;;;;;AAkBO,MAAMA,IAAwB,CAAC;AAAA,EACpC,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AACF,MAA0B;AACxB,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA,GACZ,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE,GAC/BC,IAAkBH,EAAM,KAAA,EAAO,YAAA,GAE/BI,IAAgBC,EAAQ,MACxBF,MAAoB,KACfX,IAGFA,EAAM,OAAO,CAACc,MACZA,EAAK,KAAK,YAAA,EAAc,SAASH,CAAe,CACxD,GACA,CAACX,GAAOW,CAAe,CAAC;AAE3B,MAAII;AACJ,SAAIJ,MAAoB,KACtBI,IAAkBX,IAElBW,IAAkBV,GAIlB,gBAAAW,EAAC,OAAA,EAAI,WAAWC,GACd,UAAA;AAAA,IAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWC,GACd,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,WAAS;AAAA,QACT,aAAalB;AAAA,QACb,OAAOM;AAAA,QACP,UAAU,CAACa,MAAU;AACnB,UAAAZ,EAASY,EAAM,OAAO,KAAK;AAAA,QAC7B;AAAA,QACA,cAAYlB;AAAA,MAAA;AAAA,IAAA,GAEhB;AAAA,IACA,gBAAAa,EAAC,MAAA,EAAG,WAAWM,GACZ,UAAA;AAAA,MAAAV,EAAc,WAAW,KACxB,gBAAAM,EAAC,QAAG,WAAWK,GAAsB,UAAAR,GAAgB;AAAA,MAEtDH,EAAc,IAAI,CAACE,MAAS;AAC3B,cAAMU,IAAgBC,EAAGC,GAAoB;AAAA,UAC3C,CAACC,CAAwB,GAAGb,EAAK,OAAOb;AAAA,QAAA,CACzC;AAED,YAAI2B,IAAsC;AAC1C,eAAId,EAAK,eAAe,QAAQA,EAAK,gBAAgB,OACnDc,sBACG,QAAA,EAAK,WAAWC,GACd,YAAK,aACR,sBAKD,MAAA,EACC,UAAA,gBAAAb;AAAA,UAACc;AAAA,UAAA;AAAA,YACC,IAAIhB,EAAK;AAAA,YACT,WAAWU;AAAA,YACX,SAAS,MAAM;AACb,cAAAlB,EAAA;AAAA,YACF;AAAA,YAEA,UAAA;AAAA,cAAA,gBAAAY,EAAC,QAAA,EAAK,WAAWa,GAAyB,YAAK,MAAK;AAAA,cACnDH;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,EACH,GAVOd,EAAK,EAWd;AAAA,MAEJ,CAAC;AAAA,IAAA,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useUiTranslation as y } from "../../../i18n/useUiTranslation.js";
|
|
3
|
+
import { Link as M } from "@plumile/router";
|
|
4
|
+
import { SidebarHomeSvg as S } from "../../../icons/SidebarHomeSvg.js";
|
|
5
|
+
import { breadcrumbItem as o, homeLink as A, homeIcon as B, breadcrumbList as I, breadcrumbSeparator as k, breadcrumb as w } from "./breadcrumbNavigation.css.js";
|
|
6
|
+
import { cx as x } from "../../../theme/tools.js";
|
|
7
|
+
import { BreadcrumbMenuDropdown as u } from "./BreadcrumbMenuDropdown.js";
|
|
8
|
+
const T = (p) => {
|
|
9
|
+
const { organization: c, group: t, project: n, groupMenu: d, projectMenu: h, className: g } = p, { t: a } = y(), i = a("navigation.breadcrumb.empty.matches"), m = a("navigation.breadcrumb.search.groups"), L = a("navigation.breadcrumb.empty.groups"), f = a("navigation.breadcrumb.menu.group"), s = a("navigation.breadcrumb.search.projects"), j = a("navigation.breadcrumb.empty.projects"), v = a("navigation.breadcrumb.menu.project"), e = [];
|
|
10
|
+
e.push(
|
|
11
|
+
/* @__PURE__ */ r("li", { className: o, children: /* @__PURE__ */ r(
|
|
12
|
+
M,
|
|
13
|
+
{
|
|
14
|
+
to: c.to,
|
|
15
|
+
className: A,
|
|
16
|
+
"aria-label": `Organization: ${c.name}`,
|
|
17
|
+
children: /* @__PURE__ */ r(S, { width: 16, height: 16, className: B })
|
|
18
|
+
}
|
|
19
|
+
) }, "home")
|
|
20
|
+
), t != null && e.push(
|
|
21
|
+
/* @__PURE__ */ r("li", { className: o, children: /* @__PURE__ */ r(
|
|
22
|
+
u,
|
|
23
|
+
{
|
|
24
|
+
node: t,
|
|
25
|
+
menu: d,
|
|
26
|
+
ariaLabel: f,
|
|
27
|
+
searchPlaceholder: m,
|
|
28
|
+
searchAriaLabel: m,
|
|
29
|
+
emptyLabel: L,
|
|
30
|
+
emptyMatchesLabel: i
|
|
31
|
+
}
|
|
32
|
+
) }, "group")
|
|
33
|
+
), n != null && e.push(
|
|
34
|
+
/* @__PURE__ */ r("li", { className: o, children: /* @__PURE__ */ r(
|
|
35
|
+
u,
|
|
36
|
+
{
|
|
37
|
+
node: n,
|
|
38
|
+
menu: h,
|
|
39
|
+
ariaLabel: v,
|
|
40
|
+
searchPlaceholder: s,
|
|
41
|
+
searchAriaLabel: s,
|
|
42
|
+
emptyLabel: j,
|
|
43
|
+
emptyMatchesLabel: i
|
|
44
|
+
}
|
|
45
|
+
) }, "project")
|
|
46
|
+
);
|
|
47
|
+
const N = e.flatMap((l, b) => b === 0 ? [l] : [
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
"li",
|
|
50
|
+
{
|
|
51
|
+
className: k,
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
children: "/"
|
|
54
|
+
},
|
|
55
|
+
`separator-${b}`
|
|
56
|
+
),
|
|
57
|
+
l
|
|
58
|
+
]);
|
|
59
|
+
return /* @__PURE__ */ r("nav", { className: x(w, g), "aria-label": "Breadcrumb", children: /* @__PURE__ */ r("ol", { className: I, children: N }) });
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
T as BreadcrumbNavigation
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=BreadcrumbNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbNavigation.js","sources":["../../../../../src/atomic/molecules/breadcrumb_navigation/BreadcrumbNavigation.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport { useUiTranslation } from '../../../i18n/useUiTranslation.js';\nimport { Link } from '@plumile/router';\nimport { SidebarHomeSvg } from '../../../icons/SidebarHomeSvg.js';\n\nimport * as styles from './breadcrumbNavigation.css.js';\nimport { cx } from '../../../theme/tools.js';\nimport { BreadcrumbMenuDropdown } from './BreadcrumbMenuDropdown.js';\nimport type { BreadcrumbMenuConfig, BreadcrumbNode } from './types.js';\n\ntype Props = {\n organization: BreadcrumbNode;\n group?: BreadcrumbNode | null;\n project?: BreadcrumbNode | null;\n groupMenu?: BreadcrumbMenuConfig;\n projectMenu?: BreadcrumbMenuConfig;\n className?: string;\n};\n\nexport const BreadcrumbNavigation = (props: Props): JSX.Element => {\n const { organization, group, project, groupMenu, projectMenu, className } =\n props;\n const { t } = useUiTranslation();\n const emptyMatchesLabel = t('navigation.breadcrumb.empty.matches');\n\n const groupSearchLabel = t('navigation.breadcrumb.search.groups');\n const groupEmptyLabel = t('navigation.breadcrumb.empty.groups');\n const groupMenuAriaLabel = t('navigation.breadcrumb.menu.group');\n\n const projectSearchLabel = t('navigation.breadcrumb.search.projects');\n const projectEmptyLabel = t('navigation.breadcrumb.empty.projects');\n const projectMenuAriaLabel = t('navigation.breadcrumb.menu.project');\n const breadcrumbItems: JSX.Element[] = [];\n\n breadcrumbItems.push(\n <li key=\"home\" className={styles.breadcrumbItem}>\n <Link\n to={organization.to}\n className={styles.homeLink}\n aria-label={`Organization: ${organization.name}`}\n >\n <SidebarHomeSvg width={16} height={16} className={styles.homeIcon} />\n </Link>\n </li>,\n );\n\n if (group != null) {\n breadcrumbItems.push(\n <li key=\"group\" className={styles.breadcrumbItem}>\n <BreadcrumbMenuDropdown\n node={group}\n menu={groupMenu}\n ariaLabel={groupMenuAriaLabel}\n searchPlaceholder={groupSearchLabel}\n searchAriaLabel={groupSearchLabel}\n emptyLabel={groupEmptyLabel}\n emptyMatchesLabel={emptyMatchesLabel}\n />\n </li>,\n );\n }\n\n if (project != null) {\n breadcrumbItems.push(\n <li key=\"project\" className={styles.breadcrumbItem}>\n <BreadcrumbMenuDropdown\n node={project}\n menu={projectMenu}\n ariaLabel={projectMenuAriaLabel}\n searchPlaceholder={projectSearchLabel}\n searchAriaLabel={projectSearchLabel}\n emptyLabel={projectEmptyLabel}\n emptyMatchesLabel={emptyMatchesLabel}\n />\n </li>,\n );\n }\n\n const breadcrumbsWithSeparators = breadcrumbItems.flatMap((item, index) => {\n if (index === 0) {\n return [item];\n }\n return [\n <li\n key={`separator-${index}`}\n className={styles.breadcrumbSeparator}\n aria-hidden=\"true\"\n >\n /{/* <ChevronRightSvg width={16} height={16} /> */}\n </li>,\n item,\n ];\n });\n\n return (\n <nav className={cx(styles.breadcrumb, className)} aria-label=\"Breadcrumb\">\n <ol className={styles.breadcrumbList}>{breadcrumbsWithSeparators}</ol>\n </nav>\n );\n};\n\nexport type {\n BreadcrumbNode,\n BreadcrumbMenuItem,\n BreadcrumbMenuConfig,\n} from './types.js';\n"],"names":["BreadcrumbNavigation","props","organization","group","project","groupMenu","projectMenu","className","t","useUiTranslation","emptyMatchesLabel","groupSearchLabel","groupEmptyLabel","groupMenuAriaLabel","projectSearchLabel","projectEmptyLabel","projectMenuAriaLabel","breadcrumbItems","jsx","styles.breadcrumbItem","Link","styles.homeLink","SidebarHomeSvg","styles.homeIcon","BreadcrumbMenuDropdown","breadcrumbsWithSeparators","item","index","styles.breadcrumbSeparator","cx","styles.breadcrumb","styles.breadcrumbList"],"mappings":";;;;;;;AAmBO,MAAMA,IAAuB,CAACC,MAA8B;AACjE,QAAM,EAAE,cAAAC,GAAc,OAAAC,GAAO,SAAAC,GAAS,WAAAC,GAAW,aAAAC,GAAa,WAAAC,MAC5DN,GACI,EAAE,GAAAO,EAAA,IAAMC,EAAA,GACRC,IAAoBF,EAAE,qCAAqC,GAE3DG,IAAmBH,EAAE,qCAAqC,GAC1DI,IAAkBJ,EAAE,oCAAoC,GACxDK,IAAqBL,EAAE,kCAAkC,GAEzDM,IAAqBN,EAAE,uCAAuC,GAC9DO,IAAoBP,EAAE,sCAAsC,GAC5DQ,IAAuBR,EAAE,oCAAoC,GAC7DS,IAAiC,CAAA;AAEvC,EAAAA,EAAgB;AAAA,IACd,gBAAAC,EAAC,MAAA,EAAc,WAAWC,GACxB,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,IAAIlB,EAAa;AAAA,QACjB,WAAWmB;AAAAA,QACX,cAAY,iBAAiBnB,EAAa,IAAI;AAAA,QAE9C,UAAA,gBAAAgB,EAACI,KAAe,OAAO,IAAI,QAAQ,IAAI,WAAWC,EAAO,CAAU;AAAA,MAAA;AAAA,IAAA,KAN/D,MAQR;AAAA,EAAA,GAGEpB,KAAS,QACXc,EAAgB;AAAA,IACd,gBAAAC,EAAC,MAAA,EAAe,WAAWC,GACzB,UAAA,gBAAAD;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAMrB;AAAA,QACN,MAAME;AAAA,QACN,WAAWQ;AAAA,QACX,mBAAmBF;AAAA,QACnB,iBAAiBA;AAAA,QACjB,YAAYC;AAAA,QACZ,mBAAAF;AAAA,MAAA;AAAA,IAAA,KARI,OAUR;AAAA,EAAA,GAIAN,KAAW,QACba,EAAgB;AAAA,IACd,gBAAAC,EAAC,MAAA,EAAiB,WAAWC,GAC3B,UAAA,gBAAAD;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAMpB;AAAA,QACN,MAAME;AAAA,QACN,WAAWU;AAAA,QACX,mBAAmBF;AAAA,QACnB,iBAAiBA;AAAA,QACjB,YAAYC;AAAA,QACZ,mBAAAL;AAAA,MAAA;AAAA,IAAA,KARI,SAUR;AAAA,EAAA;AAIJ,QAAMe,IAA4BR,EAAgB,QAAQ,CAACS,GAAMC,MAC3DA,MAAU,IACL,CAACD,CAAI,IAEP;AAAA,IACL,gBAAAR;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWU;AAAAA,QACX,eAAY;AAAA,QACb,UAAA;AAAA,MAAA;AAAA,MAHM,aAAaD,CAAK;AAAA,IAAA;AAAA,IAMzBD;AAAA,EAAA,CAEH;AAED,2BACG,OAAA,EAAI,WAAWG,EAAGC,GAAmBvB,CAAS,GAAG,cAAW,cAC3D,4BAAC,MAAA,EAAG,WAAWwB,GAAwB,aAA0B,GACnE;AAEJ;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
var q = "_1u1q1110 txvbqb9io txvbqbco", x = "_1u1q1111 txvbqb9io txvbqbco txvbqbfax txvbqbfbo txvbqbl9f txvbqbaof", t = "_1u1q1112 txvbqb9io txvbqbco", o = "_1u1q1113 txvbqb9io txvbqbai6 txvbqbcf txvbqbanx", r = "_1u1q1114 txvbqb8f txvbqbamo txvbqb66 txvbqbeef txvbqbv8t txvbqbegx", a = "_1u1q1115 txvbqb9jf txvbqbco txvbqbao6", e = "_1u1q1116 txvbqbv4z txvbqb77 txvbqb6x txvbqb7k", u = "_1u1q1117 txvbqb2w txvbqbv8p", p = "_1u1q1119 _1u1q1118 txvbqb78 txvbqb6x txvbqb7k txvbqb9jf txvbqbco txvbqb96 txvbqbamo txvbqbv8p txvbqb3b txvbqbf3x", c = "_1u1q111a txvbqb9io txvbqbco txvbqbdnx txvbqbv8t txvbqb8x txvbqbamx", i = "_1u1q111c _1u1q111b txvbqb78 txvbqb6x txvbqb7k txvbqb9io txvbqbco txvbqbdnx txvbqbtwo txvbqbc66 txvbqbk6f txvbqbjho txvbqb1rf txvbqb12f txvbqb1px txvbqbv31 txvbqbv8p txvbqbv txvbqbl9f", m = "_1u1q111d txvbqb9jf txvbqbco txvbqbdnx txvbqbc6o txvbqb1qx txvbqbv8p txvbqb78 txvbqb6x txvbqb7k", _ = "_1u1q111e txvbqbv4z", f = "_1u1q111h _1u1q111g txvbqbl9x txvbqbkcx txvbqbjcf txvbqb8r6 txvbqb6l", n = "_1u1q111i txvbqb9io txvbqbai6 txvbqbaof", d = "_1u1q111j txvbqb9io txvbqbco txvbqbdoo", l = "_1u1q111k txvbqb8o txvbqbamo txvbqb66 txvbqbeef txvbqbv8t", k = "_1u1q111l txvbqb9io", h = "_1u1q111m txvbqbfax txvbqbfbo txvbqbl9f txvbqb9io txvbqbai6 txvbqbanx txvbqbirx txvbqbl7o", j = "_1u1q111o _1u1q111n txvbqb78 txvbqb6w txvbqb7k txvbqb9io txvbqbai6 txvbqbanx txvbqboif txvbqbnv6 txvbqbp5f txvbqblx6 txvbqb1rf txvbqb3b txvbqbv8p", I = "_1u1q111p txvbqbv2j txvbqbv7z", L = "_1u1q111q txvbqb8x txvbqbamo", s = "_1u1q111r txvbqb8o txvbqbv8r", w = "_1u1q111s txvbqbl9x txvbqb8x txvbqbv8r";
|
|
4
|
+
export {
|
|
5
|
+
q as breadcrumb,
|
|
6
|
+
e as breadcrumbChevron,
|
|
7
|
+
i as breadcrumbChevronButton,
|
|
8
|
+
u as breadcrumbChevronOpen,
|
|
9
|
+
t as breadcrumbItem,
|
|
10
|
+
r as breadcrumbLabel,
|
|
11
|
+
p as breadcrumbLink,
|
|
12
|
+
x as breadcrumbList,
|
|
13
|
+
a as breadcrumbNameRow,
|
|
14
|
+
o as breadcrumbSection,
|
|
15
|
+
c as breadcrumbSeparator,
|
|
16
|
+
_ as homeIcon,
|
|
17
|
+
m as homeLink,
|
|
18
|
+
n as popoverContent,
|
|
19
|
+
w as popoverEmpty,
|
|
20
|
+
d as popoverHeader,
|
|
21
|
+
j as popoverItem,
|
|
22
|
+
I as popoverItemActive,
|
|
23
|
+
s as popoverItemDescription,
|
|
24
|
+
L as popoverItemName,
|
|
25
|
+
h as popoverList,
|
|
26
|
+
f as popoverPanel,
|
|
27
|
+
k as popoverSearch,
|
|
28
|
+
l as popoverTitle
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=breadcrumbNavigation.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbNavigation.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes _1u1q111f{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}._1u1q1119:hover{color:var(--kronex-colors-primary);text-decoration:none}._1u1q1119:focus{outline:none;color:var(--kronex-colors-primary)}._1u1q111c:hover:not(:disabled){background-color:var(--kronex-colors-backgroundTertiary);color:var(--kronex-colors-text)}._1u1q111h{animation:_1u1q111f .16s ease}._1u1q111o:hover{background-color:var(--kronex-colors-backgroundSecondary);color:var(--kronex-colors-text)}._1u1q111o:focus{outline:2px solid var(--kronex-colors-primaryLight);outline-offset:2px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx as N, jsxs as st } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as ct, useContext as it, useState as V, useRef as v, useCallback as w, useLayoutEffect as lt, useEffect as h, isValidElement as ut, cloneElement as ft } from "react";
|
|
3
|
+
import { createPortal as at } from "react-dom";
|
|
4
|
+
import { contentPositioned as dt, content as pt, container as mt } from "./dropdown.css.js";
|
|
5
|
+
import { cx as $ } from "../../../theme/tools.js";
|
|
6
|
+
const q = ct(null), xt = () => {
|
|
7
|
+
const c = it(q);
|
|
8
|
+
if (c == null)
|
|
9
|
+
throw new Error("useDropdown must be used within a <Dropdown />");
|
|
10
|
+
return c;
|
|
11
|
+
}, wt = (c) => c == null || typeof c != "object" ? !1 : c.$$typeof === Symbol.for("react.forward_ref"), kt = ({
|
|
12
|
+
trigger: c,
|
|
13
|
+
children: H,
|
|
14
|
+
className: I,
|
|
15
|
+
contentClassName: U,
|
|
16
|
+
placement: x = "bottom-start",
|
|
17
|
+
offset: l = 4,
|
|
18
|
+
matchTriggerWidth: M = !0,
|
|
19
|
+
open: T,
|
|
20
|
+
defaultOpen: _ = !1,
|
|
21
|
+
onOpenChange: W,
|
|
22
|
+
closeOnItemClick: F = !1,
|
|
23
|
+
portalContainer: G,
|
|
24
|
+
ariaLabel: k
|
|
25
|
+
}) => {
|
|
26
|
+
const D = T != null, [J, Q] = V(_);
|
|
27
|
+
let e = J;
|
|
28
|
+
D && (e = !!T);
|
|
29
|
+
const R = v(null), C = v(null), f = v(null), [g, X] = V(null), p = v([]), a = w(
|
|
30
|
+
(t) => {
|
|
31
|
+
D || Q(t), W?.(t);
|
|
32
|
+
},
|
|
33
|
+
[D, W]
|
|
34
|
+
), K = w(() => {
|
|
35
|
+
a(!e);
|
|
36
|
+
}, [e, a]), d = w(() => {
|
|
37
|
+
a(!1);
|
|
38
|
+
}, [a]), Y = w(() => {
|
|
39
|
+
a(!0);
|
|
40
|
+
}, [a]), b = w(() => {
|
|
41
|
+
const t = C.current, r = f.current;
|
|
42
|
+
if (t == null || r == null)
|
|
43
|
+
return;
|
|
44
|
+
const n = t.getBoundingClientRect();
|
|
45
|
+
let o = 0, s = 0;
|
|
46
|
+
switch (x) {
|
|
47
|
+
case "bottom-start":
|
|
48
|
+
o = n.bottom + l, s = n.left;
|
|
49
|
+
break;
|
|
50
|
+
case "bottom-end":
|
|
51
|
+
o = n.bottom + l, s = n.right - r.offsetWidth;
|
|
52
|
+
break;
|
|
53
|
+
case "top-start":
|
|
54
|
+
o = n.top - r.offsetHeight - l, s = n.left;
|
|
55
|
+
break;
|
|
56
|
+
case "top-end":
|
|
57
|
+
o = n.top - r.offsetHeight - l, s = n.right - r.offsetWidth;
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
o = n.bottom + l, s = n.left;
|
|
61
|
+
}
|
|
62
|
+
const O = window.innerWidth, L = window.innerHeight;
|
|
63
|
+
let P;
|
|
64
|
+
M && (P = n.width);
|
|
65
|
+
const z = P ?? r.offsetWidth;
|
|
66
|
+
s + z > O - 4 && (s = Math.max(4, O - z - 4)), s < 4 && (s = 4);
|
|
67
|
+
const y = r.offsetHeight;
|
|
68
|
+
if (o + y > L - 4)
|
|
69
|
+
if (x.startsWith("bottom")) {
|
|
70
|
+
const A = n.top - y - l;
|
|
71
|
+
A >= 4 ? o = A : o = Math.max(4, L - y - 4);
|
|
72
|
+
} else
|
|
73
|
+
o = Math.max(4, L - y - 4);
|
|
74
|
+
o < 4 && (o = 4), X({ top: o, left: s, width: P });
|
|
75
|
+
}, [x, l, M]);
|
|
76
|
+
lt(() => {
|
|
77
|
+
e && b();
|
|
78
|
+
}, [e, b, H]), h(() => {
|
|
79
|
+
if (!e) return;
|
|
80
|
+
const t = () => {
|
|
81
|
+
b();
|
|
82
|
+
};
|
|
83
|
+
window.addEventListener("resize", t), window.addEventListener("scroll", t, !0);
|
|
84
|
+
const r = () => {
|
|
85
|
+
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
|
|
86
|
+
};
|
|
87
|
+
p.current.push(r);
|
|
88
|
+
}, [e, b]), h(() => {
|
|
89
|
+
if (!e) return;
|
|
90
|
+
const t = (o) => {
|
|
91
|
+
const s = o.target;
|
|
92
|
+
R.current != null && f.current != null && !R.current.contains(s) && !f.current.contains(s) && d();
|
|
93
|
+
}, r = (o) => {
|
|
94
|
+
o.key === "Escape" && (d(), C.current?.focus());
|
|
95
|
+
};
|
|
96
|
+
document.addEventListener("mousedown", t), document.addEventListener("keydown", r);
|
|
97
|
+
const n = () => {
|
|
98
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", r);
|
|
99
|
+
};
|
|
100
|
+
p.current.push(n);
|
|
101
|
+
}, [e, d]), h(() => {
|
|
102
|
+
if (!e) return;
|
|
103
|
+
f.current?.querySelector(
|
|
104
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
105
|
+
)?.focus();
|
|
106
|
+
}, [e]), h(() => {
|
|
107
|
+
if (!e || !F) return;
|
|
108
|
+
const t = (n) => {
|
|
109
|
+
f.current?.contains(n.target) && d();
|
|
110
|
+
};
|
|
111
|
+
document.addEventListener("click", t, { capture: !0 });
|
|
112
|
+
const r = () => {
|
|
113
|
+
document.removeEventListener("click", t, { capture: !0 });
|
|
114
|
+
};
|
|
115
|
+
p.current.push(r);
|
|
116
|
+
}, [e, F, d]), h(() => () => {
|
|
117
|
+
p.current.forEach((t) => {
|
|
118
|
+
t();
|
|
119
|
+
}), p.current = [];
|
|
120
|
+
}, []);
|
|
121
|
+
let i = c;
|
|
122
|
+
if (typeof c == "function" && (i = c(e)), !ut(i))
|
|
123
|
+
throw new Error("Dropdown trigger must be a React element.");
|
|
124
|
+
const S = typeof i.type == "string", Z = S && i.type === "button";
|
|
125
|
+
if (!(S || typeof i.type == "function" || wt(i.type)))
|
|
126
|
+
throw new Error(
|
|
127
|
+
"Dropdown trigger must be a DOM element or component that accepts a ref."
|
|
128
|
+
);
|
|
129
|
+
const E = i.props.ref ?? i.ref, tt = (t) => {
|
|
130
|
+
C.current = t, typeof E == "function" ? E(t) : E != null && (E.current = t);
|
|
131
|
+
}, m = i.props, et = (t) => {
|
|
132
|
+
m.onClick?.(t), !t.defaultPrevented && K();
|
|
133
|
+
}, nt = (t) => {
|
|
134
|
+
m.onKeyDown?.(t), !t.defaultPrevented && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), K());
|
|
135
|
+
}, u = {
|
|
136
|
+
onClick: et,
|
|
137
|
+
"aria-haspopup": "menu",
|
|
138
|
+
"aria-expanded": e
|
|
139
|
+
};
|
|
140
|
+
k != null && k !== "" && (u["aria-label"] = k), Z ? m.type == null && (u.type = "button") : (u.onKeyDown = nt, m.role == null && (u.role = "button"), m.tabIndex == null && (u.tabIndex = 0)), u.ref = tt;
|
|
141
|
+
let j = {};
|
|
142
|
+
g != null && (j = {
|
|
143
|
+
top: g.top,
|
|
144
|
+
left: g.left,
|
|
145
|
+
width: g.width
|
|
146
|
+
});
|
|
147
|
+
const ot = G ?? document.body, rt = {
|
|
148
|
+
close: d,
|
|
149
|
+
open: Y,
|
|
150
|
+
isOpen: e
|
|
151
|
+
};
|
|
152
|
+
let B = null;
|
|
153
|
+
return e && (B = at(
|
|
154
|
+
/* @__PURE__ */ N(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
ref: f,
|
|
158
|
+
role: "menu",
|
|
159
|
+
className: $(
|
|
160
|
+
pt,
|
|
161
|
+
dt,
|
|
162
|
+
U
|
|
163
|
+
),
|
|
164
|
+
style: j,
|
|
165
|
+
children: H
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
ot
|
|
169
|
+
)), /* @__PURE__ */ st(q.Provider, { value: rt, children: [
|
|
170
|
+
/* @__PURE__ */ N("div", { className: $(mt, I), ref: R, children: ft(i, u) }),
|
|
171
|
+
B
|
|
172
|
+
] });
|
|
173
|
+
};
|
|
174
|
+
export {
|
|
175
|
+
kt as Dropdown,
|
|
176
|
+
xt as useDropdown
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=Dropdown.js.map
|