@walkeros/explorer 1.0.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/dist/{chunk-VWWAIDNX.mjs → chunk-YKT4D7MG.mjs} +201 -53
- package/dist/chunk-YKT4D7MG.mjs.map +1 -0
- package/dist/components/atoms/alert.d.ts +29 -0
- package/dist/components/atoms/alert.d.ts.map +1 -0
- package/dist/components/atoms/alert.js +19 -0
- package/dist/components/atoms/alert.js.map +1 -0
- package/dist/components/atoms/alert.stories.d.ts +7 -0
- package/dist/components/atoms/alert.stories.d.ts.map +1 -0
- package/dist/components/atoms/alert.stories.js +14 -0
- package/dist/components/atoms/alert.stories.js.map +1 -0
- package/dist/components/atoms/button.stories.d.ts +14 -0
- package/dist/components/atoms/button.stories.d.ts.map +1 -0
- package/dist/components/atoms/button.stories.js +25 -0
- package/dist/components/atoms/button.stories.js.map +1 -0
- package/dist/components/atoms/code.d.ts.map +1 -1
- package/dist/components/atoms/code.js +14 -2
- package/dist/components/atoms/code.js.map +1 -1
- package/dist/components/atoms/footer.stories.d.ts +14 -0
- package/dist/components/atoms/footer.stories.d.ts.map +1 -0
- package/dist/components/atoms/footer.stories.js +29 -0
- package/dist/components/atoms/footer.stories.js.map +1 -0
- package/dist/components/atoms/form-field.d.ts +28 -0
- package/dist/components/atoms/form-field.d.ts.map +1 -0
- package/dist/components/atoms/form-field.js +16 -0
- package/dist/components/atoms/form-field.js.map +1 -0
- package/dist/components/atoms/form-field.stories.d.ts +7 -0
- package/dist/components/atoms/form-field.stories.d.ts.map +1 -0
- package/dist/components/atoms/form-field.stories.js +16 -0
- package/dist/components/atoms/form-field.stories.js.map +1 -0
- package/dist/components/atoms/form-input.d.ts +43 -0
- package/dist/components/atoms/form-input.d.ts.map +1 -0
- package/dist/components/atoms/form-input.js +26 -0
- package/dist/components/atoms/form-input.js.map +1 -0
- package/dist/components/atoms/form-input.stories.d.ts +7 -0
- package/dist/components/atoms/form-input.stories.d.ts.map +1 -0
- package/dist/components/atoms/form-input.stories.js +17 -0
- package/dist/components/atoms/form-input.stories.js.map +1 -0
- package/dist/components/atoms/form-textarea.d.ts +41 -0
- package/dist/components/atoms/form-textarea.d.ts.map +1 -0
- package/dist/components/atoms/form-textarea.js +26 -0
- package/dist/components/atoms/form-textarea.js.map +1 -0
- package/dist/components/atoms/form-textarea.stories.d.ts +7 -0
- package/dist/components/atoms/form-textarea.stories.d.ts.map +1 -0
- package/dist/components/atoms/form-textarea.stories.js +17 -0
- package/dist/components/atoms/form-textarea.stories.js.map +1 -0
- package/dist/components/atoms/grid.stories.d.ts +18 -0
- package/dist/components/atoms/grid.stories.d.ts.map +1 -0
- package/dist/components/atoms/grid.stories.js +60 -0
- package/dist/components/atoms/grid.stories.js.map +1 -0
- package/dist/components/atoms/header.stories.d.ts +15 -0
- package/dist/components/atoms/header.stories.d.ts.map +1 -0
- package/dist/components/atoms/header.stories.js +37 -0
- package/dist/components/atoms/header.stories.js.map +1 -0
- package/dist/components/atoms/icons/icon.stories.d.ts +18 -0
- package/dist/components/atoms/icons/icon.stories.d.ts.map +1 -0
- package/dist/components/atoms/icons/icon.stories.js +37 -0
- package/dist/components/atoms/icons/icon.stories.js.map +1 -0
- package/dist/components/atoms/panel-hints.stories.d.ts +14 -0
- package/dist/components/atoms/panel-hints.stories.d.ts.map +1 -0
- package/dist/components/atoms/panel-hints.stories.js +35 -0
- package/dist/components/atoms/panel-hints.stories.js.map +1 -0
- package/dist/components/atoms/spinner.d.ts +17 -0
- package/dist/components/atoms/spinner.d.ts.map +1 -0
- package/dist/components/atoms/spinner.js +14 -0
- package/dist/components/atoms/spinner.js.map +1 -0
- package/dist/components/atoms/spinner.stories.d.ts +7 -0
- package/dist/components/atoms/spinner.stories.d.ts.map +1 -0
- package/dist/components/atoms/spinner.stories.js +9 -0
- package/dist/components/atoms/spinner.stories.js.map +1 -0
- package/dist/components/atoms/submit-button.d.ts +34 -0
- package/dist/components/atoms/submit-button.d.ts.map +1 -0
- package/dist/components/atoms/submit-button.js +18 -0
- package/dist/components/atoms/submit-button.js.map +1 -0
- package/dist/components/atoms/submit-button.stories.d.ts +7 -0
- package/dist/components/atoms/submit-button.stories.d.ts.map +1 -0
- package/dist/components/atoms/submit-button.stories.js +13 -0
- package/dist/components/atoms/submit-button.stories.js.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js +1 -1
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js.map +1 -1
- package/dist/components/molecules/code-box.stories.d.ts +8 -0
- package/dist/components/molecules/code-box.stories.d.ts.map +1 -1
- package/dist/components/molecules/code-box.stories.js +36 -0
- package/dist/components/molecules/code-box.stories.js.map +1 -1
- package/dist/components/molecules/config-form-card.d.ts +50 -0
- package/dist/components/molecules/config-form-card.d.ts.map +1 -0
- package/dist/components/molecules/config-form-card.js +30 -0
- package/dist/components/molecules/config-form-card.js.map +1 -0
- package/dist/components/molecules/config-form-card.stories.d.ts +7 -0
- package/dist/components/molecules/config-form-card.stories.d.ts.map +1 -0
- package/dist/components/molecules/config-form-card.stories.js +21 -0
- package/dist/components/molecules/config-form-card.stories.js.map +1 -0
- package/dist/components/molecules/dropdown.d.ts +68 -0
- package/dist/components/molecules/dropdown.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.js +47 -0
- package/dist/components/molecules/dropdown.js.map +1 -0
- package/dist/components/molecules/dropdown.stories.d.ts +7 -0
- package/dist/components/molecules/dropdown.stories.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.stories.js +18 -0
- package/dist/components/molecules/dropdown.stories.js.map +1 -0
- package/dist/components/molecules/flow-deploy-panel.d.ts +31 -0
- package/dist/components/molecules/flow-deploy-panel.d.ts.map +1 -0
- package/dist/components/molecules/flow-deploy-panel.js +72 -0
- package/dist/components/molecules/flow-deploy-panel.js.map +1 -0
- package/dist/components/molecules/flow-deploy-panel.stories.d.ts +40 -0
- package/dist/components/molecules/flow-deploy-panel.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-deploy-panel.stories.js +145 -0
- package/dist/components/molecules/flow-deploy-panel.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.d.ts.map +1 -1
- package/dist/components/molecules/flow-map/FlowMap.stories.js +7 -1
- package/dist/components/molecules/flow-map/FlowMap.stories.js.map +1 -1
- package/dist/components/molecules/flow-selector.d.ts +19 -0
- package/dist/components/molecules/flow-selector.d.ts.map +1 -0
- package/dist/components/molecules/flow-selector.js +26 -0
- package/dist/components/molecules/flow-selector.js.map +1 -0
- package/dist/components/molecules/flow-selector.stories.d.ts +28 -0
- package/dist/components/molecules/flow-selector.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-selector.stories.js +66 -0
- package/dist/components/molecules/flow-selector.stories.js.map +1 -0
- package/dist/components/molecules/form-card.d.ts +28 -0
- package/dist/components/molecules/form-card.d.ts.map +1 -0
- package/dist/components/molecules/form-card.js +16 -0
- package/dist/components/molecules/form-card.js.map +1 -0
- package/dist/components/molecules/form-card.stories.d.ts +7 -0
- package/dist/components/molecules/form-card.stories.d.ts.map +1 -0
- package/dist/components/molecules/form-card.stories.js +16 -0
- package/dist/components/molecules/form-card.stories.js.map +1 -0
- package/dist/components/molecules/preview.d.ts.map +1 -1
- package/dist/components/molecules/preview.js +0 -1
- package/dist/components/molecules/preview.js.map +1 -1
- package/dist/components/molecules/split-button.d.ts +25 -0
- package/dist/components/molecules/split-button.d.ts.map +1 -0
- package/dist/components/molecules/split-button.js +37 -0
- package/dist/components/molecules/split-button.js.map +1 -0
- package/dist/components/molecules/split-button.stories.d.ts +32 -0
- package/dist/components/molecules/split-button.stories.d.ts.map +1 -0
- package/dist/components/molecules/split-button.stories.js +88 -0
- package/dist/components/molecules/split-button.stories.js.map +1 -0
- package/dist/hooks/useDropdown.d.ts +34 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -0
- package/dist/hooks/useDropdown.js +66 -0
- package/dist/hooks/useDropdown.js.map +1 -0
- package/dist/index.d.cts +441 -2
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +663 -28
- package/dist/index.mjs.map +1 -1
- package/dist/{monaco-types-4FIH5OVX.mjs → monaco-types-OLSF6MIE.mjs} +2 -2
- package/dist/styles.css +579 -0
- package/package.json +5 -14
- package/dist/chunk-VWWAIDNX.mjs.map +0 -1
- /package/dist/{monaco-types-4FIH5OVX.mjs.map → monaco-types-OLSF6MIE.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-card.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/form-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,aAAa;IAC5B,mBAAmB;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IACvC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAe,EACf,SAAc,GACf,EAAE,aAAa,2CAef"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* FormCard - Container for form-based content
|
|
4
|
+
*
|
|
5
|
+
* Pure UI component for centered form layouts.
|
|
6
|
+
* Typically used for auth pages, settings, etc.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <FormCard title="Sign in" maxWidth="sm">
|
|
10
|
+
* <form>...</form>
|
|
11
|
+
* </FormCard>
|
|
12
|
+
*/
|
|
13
|
+
export function FormCard({ children, title, subtitle, footer, maxWidth = 'md', className = '', }) {
|
|
14
|
+
return (_jsxs("div", { className: `elb-form-card elb-form-card--${maxWidth} ${className}`.trim(), children: [(title || subtitle) && (_jsxs("div", { className: "elb-form-card__header", children: [title && _jsx("h1", { className: "elb-form-card__title", children: title }), subtitle && _jsx("p", { className: "elb-form-card__subtitle", children: subtitle })] })), _jsx("div", { className: "elb-form-card__content", children: children }), footer && _jsx("div", { className: "elb-form-card__footer", children: footer })] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=form-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-card.js","sourceRoot":"","sources":["../../../src/components/molecules/form-card.tsx"],"names":[],"mappings":";AAiBA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,GACA;IACd,OAAO,CACL,eACE,SAAS,EAAE,gCAAgC,QAAQ,IAAI,SAAS,EAAE,CAAC,IAAI,EAAE,aAExE,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CACtB,eAAK,SAAS,EAAC,uBAAuB,aACnC,KAAK,IAAI,aAAI,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAM,EAC1D,QAAQ,IAAI,YAAG,SAAS,EAAC,yBAAyB,YAAE,QAAQ,GAAK,IAC9D,CACP,EACD,cAAK,SAAS,EAAC,wBAAwB,YAAE,QAAQ,GAAO,EACvD,MAAM,IAAI,cAAK,SAAS,EAAC,uBAAuB,YAAE,MAAM,GAAO,IAC5D,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FormCard } from './form-card';
|
|
3
|
+
declare const meta: Meta<typeof FormCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FormCard>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=form-card.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/form-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAI/B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FormCard } from './form-card';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Molecules/FormCard',
|
|
5
|
+
component: FormCard,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export const Default = {
|
|
10
|
+
args: {
|
|
11
|
+
title: 'Sign in',
|
|
12
|
+
maxWidth: 'sm',
|
|
13
|
+
children: _jsx("p", { children: "Form content goes here" }),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=form-card.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-card.stories.js","sourceRoot":"","sources":["../../../src/components/molecules/form-card.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,IAAI,GAA0B;IAClC,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,iDAA6B;KACxC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/preview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAA6B,MAAM,gBAAgB,CAAC;AAQrE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,GAAQ,EACR,GAAG,EACH,KAAiB,GAClB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/preview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAA6B,MAAM,gBAAgB,CAAC;AAQrE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,GAAQ,EACR,GAAG,EACH,KAAiB,GAClB,EAAE,YA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AClB,MAAM,EAAE,MAAM,CAAC,aAA2C;gCAC1D,QAAQ,EAAE,MAAM,CAAC,eAAe;6BACjC;yBACF,CAAC,CAAC;wBAEH,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;oBAC7B,CAAC;oBAAC,MAAM,CAAC;wBACP,uDAAuD;oBACzD,CAAC;gBACH,CAAC,EAAE,EAAE,CAAC,CAAC;YACT,CAAC;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,OAAO,GAAG,EAAE;YACV,IAAI,gBAAgB,CAAC,OAAO,EAAE,CAAC;gBAC7B,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACzC,CAAC;YAED,iBAAiB;YACjB,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;gBACtB,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAChC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAAC;IAErD,OAAO,CACL,KAAC,GAAG,IACF,MAAM,EAAE,KAAK,EACb,MAAM,EACJ,KAAC,aAAa,IAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,GAAI,YAGtE,cAAK,SAAS,EAAC,qBAAqB,YAClC,iBACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAC,cAAc,GACpB,GACE,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SplitButtonAction {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SplitButtonProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
actions?: SplitButtonAction[];
|
|
12
|
+
variant?: 'primary' | 'default' | 'danger';
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
loadingText?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* SplitButton - Primary button with dropdown actions
|
|
20
|
+
*
|
|
21
|
+
* Generic molecule: primary button + dropdown arrow.
|
|
22
|
+
* Click-outside and Escape to close.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SplitButton({ children, onClick, actions, variant, loading, loadingText, disabled, className, }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=split-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/split-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,OAAY,EACZ,OAAmB,EACnB,OAAe,EACf,WAAW,EACX,QAAgB,EAChB,SAAc,GACf,EAAE,gBAAgB,2CAyFlB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* SplitButton - Primary button with dropdown actions
|
|
5
|
+
*
|
|
6
|
+
* Generic molecule: primary button + dropdown arrow.
|
|
7
|
+
* Click-outside and Escape to close.
|
|
8
|
+
*/
|
|
9
|
+
export function SplitButton({ children, onClick, actions = [], variant = 'primary', loading = false, loadingText, disabled = false, className = '', }) {
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const ref = useRef(null);
|
|
12
|
+
const isDisabled = disabled || loading;
|
|
13
|
+
const handleClickOutside = useCallback((e) => {
|
|
14
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
15
|
+
setOpen(false);
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
const handleKeyDown = useCallback((e) => {
|
|
19
|
+
if (e.key === 'Escape')
|
|
20
|
+
setOpen(false);
|
|
21
|
+
}, []);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (open) {
|
|
24
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
25
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
26
|
+
return () => {
|
|
27
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
28
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}, [open, handleClickOutside, handleKeyDown]);
|
|
32
|
+
return (_jsxs("div", { ref: ref, className: `elb-split-button elb-split-button--${variant} ${className}`, children: [_jsx("button", { type: "button", className: "elb-split-button__primary", onClick: onClick, disabled: isDisabled, children: loading ? (loadingText ?? children) : children }), actions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "elb-split-button__toggle", onClick: () => setOpen(!open), disabled: isDisabled, "aria-label": "More actions", "aria-expanded": open, children: _jsx("svg", { className: "elb-split-button__arrow", width: "10", height: "6", viewBox: "0 0 10 6", fill: "currentColor", children: _jsx("path", { d: "M1 1l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", fill: "none" }) }) }), open && (_jsx("div", { className: "elb-split-button__dropdown", children: actions.map((action) => (_jsx("button", { type: "button", className: "elb-split-button__action", disabled: action.disabled, onClick: () => {
|
|
33
|
+
setOpen(false);
|
|
34
|
+
action.onClick();
|
|
35
|
+
}, children: action.label }, action.key))) }))] }))] }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=split-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-button.js","sourceRoot":"","sources":["../../../src/components/molecules/split-button.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAoBxE;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,KAAK,EACf,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,EAAE,GACG;IACjB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,MAAM,UAAU,GAAG,QAAQ,IAAI,OAAO,CAAC;IAEvC,MAAM,kBAAkB,GAAG,WAAW,CAAC,CAAC,CAAa,EAAE,EAAE;QACvD,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAc,CAAC,EAAE,CAAC;YAC3D,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,EAAE,EAAE,CAA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AO,EAAC,UAAU,EAClB,IAAI,EAAC,cAAc,YAEnB,eACE,CAAC,EAAC,cAAc,EAChB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,IAAI,EAAC,MAAM,GACX,GACE,GACC,EAER,IAAI,IAAI,CACP,cAAK,SAAS,EAAC,4BAA4B,YACxC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAEE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,EACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,GAAG,EAAE;gCACZ,OAAO,CAAC,KAAK,CAAC,CAAC;gCACf,MAAM,CAAC,OAAO,EAAE,CAAC;4BACnB,CAAC,YAEA,MAAM,CAAC,KAAK,IATR,MAAM,CAAC,GAAG,CAUR,CACV,CAAC,GACE,CACP,IACA,CACJ,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SplitButton } from './split-button';
|
|
3
|
+
/**
|
|
4
|
+
* SplitButton - Primary button with dropdown actions
|
|
5
|
+
*
|
|
6
|
+
* Generic molecule combining a primary button with a dropdown arrow
|
|
7
|
+
* that reveals secondary actions. Supports loading and disabled states.
|
|
8
|
+
*/
|
|
9
|
+
declare const meta: Meta<typeof SplitButton>;
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof SplitButton>;
|
|
12
|
+
/**
|
|
13
|
+
* Default SplitButton without actions
|
|
14
|
+
*/
|
|
15
|
+
export declare const Default: Story;
|
|
16
|
+
/**
|
|
17
|
+
* SplitButton with dropdown actions
|
|
18
|
+
*/
|
|
19
|
+
export declare const WithActions: Story;
|
|
20
|
+
/**
|
|
21
|
+
* Loading state
|
|
22
|
+
*/
|
|
23
|
+
export declare const Loading: Story;
|
|
24
|
+
/**
|
|
25
|
+
* Disabled state
|
|
26
|
+
*/
|
|
27
|
+
export declare const Disabled: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Danger variant
|
|
30
|
+
*/
|
|
31
|
+
export declare const DangerVariant: Story;
|
|
32
|
+
//# sourceMappingURL=split-button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/molecules/split-button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAIlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAiBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAa3B,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { SplitButton } from './split-button';
|
|
2
|
+
/**
|
|
3
|
+
* SplitButton - Primary button with dropdown actions
|
|
4
|
+
*
|
|
5
|
+
* Generic molecule combining a primary button with a dropdown arrow
|
|
6
|
+
* that reveals secondary actions. Supports loading and disabled states.
|
|
7
|
+
*/
|
|
8
|
+
const meta = {
|
|
9
|
+
component: SplitButton,
|
|
10
|
+
title: 'Molecules/SplitButton',
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
/**
|
|
15
|
+
* Default SplitButton without actions
|
|
16
|
+
*/
|
|
17
|
+
export const Default = {
|
|
18
|
+
args: {
|
|
19
|
+
children: 'Deploy',
|
|
20
|
+
onClick: () => console.log('deploy'),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* SplitButton with dropdown actions
|
|
25
|
+
*/
|
|
26
|
+
export const WithActions = {
|
|
27
|
+
args: {
|
|
28
|
+
children: 'Deploy',
|
|
29
|
+
onClick: () => console.log('deploy'),
|
|
30
|
+
actions: [
|
|
31
|
+
{
|
|
32
|
+
key: 'download',
|
|
33
|
+
label: 'Download Flow (.json)',
|
|
34
|
+
onClick: () => console.log('download'),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'bundle',
|
|
38
|
+
label: 'Bundle (.js)',
|
|
39
|
+
onClick: () => console.log('bundle'),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Loading state
|
|
46
|
+
*/
|
|
47
|
+
export const Loading = {
|
|
48
|
+
args: {
|
|
49
|
+
children: 'Deploy',
|
|
50
|
+
onClick: () => { },
|
|
51
|
+
loading: true,
|
|
52
|
+
loadingText: 'Deploying...',
|
|
53
|
+
actions: [
|
|
54
|
+
{ key: 'download', label: 'Download Flow (.json)', onClick: () => { } },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Disabled state
|
|
60
|
+
*/
|
|
61
|
+
export const Disabled = {
|
|
62
|
+
args: {
|
|
63
|
+
children: 'Deploy',
|
|
64
|
+
onClick: () => { },
|
|
65
|
+
disabled: true,
|
|
66
|
+
actions: [
|
|
67
|
+
{ key: 'download', label: 'Download Flow (.json)', onClick: () => { } },
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Danger variant
|
|
73
|
+
*/
|
|
74
|
+
export const DangerVariant = {
|
|
75
|
+
args: {
|
|
76
|
+
children: 'Delete Deployment',
|
|
77
|
+
onClick: () => console.log('delete'),
|
|
78
|
+
variant: 'danger',
|
|
79
|
+
actions: [
|
|
80
|
+
{
|
|
81
|
+
key: 'download',
|
|
82
|
+
label: 'Download Backup (.json)',
|
|
83
|
+
onClick: () => console.log('backup'),
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=split-button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-button.stories.js","sourceRoot":"","sources":["../../../src/components/molecules/split-button.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,IAAI,GAA6B;IACrC,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;KACrC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE;YACP;gBACE,GAAG,EAAE,UAAU;gBACf,KAAK,EAAE,uBAAuB;gBAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;aACvC;YACD;gBACE,GAAG,EAAE,QAAQ;gBACb,KAAK,EAAE,cAAc;gBACrB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;aACrC;SACF;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE;YACP,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;SACvE;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;SACvE;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE;QACJ,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE;YACP;gBACE,GAAG,EAAE,UAAU;gBACf,KAAK,EAAE,yBAAyB;gBAChC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;aACrC;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
export interface UseDropdownReturn {
|
|
3
|
+
/** Whether dropdown is currently open */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Toggle dropdown open/closed */
|
|
6
|
+
toggle: () => void;
|
|
7
|
+
/** Open the dropdown */
|
|
8
|
+
open: () => void;
|
|
9
|
+
/** Close the dropdown */
|
|
10
|
+
close: () => void;
|
|
11
|
+
/** Ref to attach to the container element for click-outside detection */
|
|
12
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* useDropdown - Manages dropdown open/close state with click-outside and keyboard handling
|
|
16
|
+
*
|
|
17
|
+
* Provides:
|
|
18
|
+
* - Open/close state management
|
|
19
|
+
* - Click-outside detection to close
|
|
20
|
+
* - Escape key handling to close
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const { isOpen, toggle, close, containerRef } = useDropdown();
|
|
24
|
+
*
|
|
25
|
+
* return (
|
|
26
|
+
* <div ref={containerRef}>
|
|
27
|
+
* <Dropdown isOpen={isOpen} onToggle={toggle}>
|
|
28
|
+
* ...
|
|
29
|
+
* </Dropdown>
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDropdown(): UseDropdownReturn;
|
|
34
|
+
//# sourceMappingURL=useDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdown.d.ts","sourceRoot":"","sources":["../../src/hooks/useDropdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wBAAwB;IACxB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,yBAAyB;IACzB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,yEAAyE;IACzE,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,IAAI,iBAAiB,CAsD/C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* useDropdown - Manages dropdown open/close state with click-outside and keyboard handling
|
|
4
|
+
*
|
|
5
|
+
* Provides:
|
|
6
|
+
* - Open/close state management
|
|
7
|
+
* - Click-outside detection to close
|
|
8
|
+
* - Escape key handling to close
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { isOpen, toggle, close, containerRef } = useDropdown();
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <div ref={containerRef}>
|
|
15
|
+
* <Dropdown isOpen={isOpen} onToggle={toggle}>
|
|
16
|
+
* ...
|
|
17
|
+
* </Dropdown>
|
|
18
|
+
* </div>
|
|
19
|
+
* );
|
|
20
|
+
*/
|
|
21
|
+
export function useDropdown() {
|
|
22
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
23
|
+
const containerRef = useRef(null);
|
|
24
|
+
const toggle = useCallback(() => {
|
|
25
|
+
setIsOpen((prev) => !prev);
|
|
26
|
+
}, []);
|
|
27
|
+
const open = useCallback(() => {
|
|
28
|
+
setIsOpen(true);
|
|
29
|
+
}, []);
|
|
30
|
+
const close = useCallback(() => {
|
|
31
|
+
setIsOpen(false);
|
|
32
|
+
}, []);
|
|
33
|
+
// Close on click outside
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!isOpen)
|
|
36
|
+
return;
|
|
37
|
+
function handleClickOutside(event) {
|
|
38
|
+
if (containerRef.current &&
|
|
39
|
+
!containerRef.current.contains(event.target)) {
|
|
40
|
+
setIsOpen(false);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
44
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
45
|
+
}, [isOpen]);
|
|
46
|
+
// Close on Escape key
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!isOpen)
|
|
49
|
+
return;
|
|
50
|
+
function handleEscape(event) {
|
|
51
|
+
if (event.key === 'Escape') {
|
|
52
|
+
setIsOpen(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
document.addEventListener('keydown', handleEscape);
|
|
56
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
57
|
+
}, [isOpen]);
|
|
58
|
+
return {
|
|
59
|
+
isOpen,
|
|
60
|
+
toggle,
|
|
61
|
+
open,
|
|
62
|
+
close,
|
|
63
|
+
containerRef,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=useDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdown.js","sourceRoot":"","sources":["../../src/hooks/useDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAgBjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,yBAAyB;IACzB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