@agentskillmania/skill-ui-shared 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/dist/components/CollapsibleCard.d.ts +22 -0
  4. package/dist/components/CollapsibleCard.d.ts.map +1 -0
  5. package/dist/components/CollapsibleCard.js +30 -0
  6. package/dist/components/CollapsibleCard.js.map +1 -0
  7. package/dist/components/CollapsibleCard.stories.d.ts +16 -0
  8. package/dist/components/CollapsibleCard.stories.d.ts.map +1 -0
  9. package/dist/components/CollapsibleCard.stories.js +57 -0
  10. package/dist/components/CollapsibleCard.stories.js.map +1 -0
  11. package/dist/components/CopyValue.d.ts +12 -0
  12. package/dist/components/CopyValue.d.ts.map +1 -0
  13. package/dist/components/CopyValue.js +39 -0
  14. package/dist/components/CopyValue.js.map +1 -0
  15. package/dist/components/EmptyState.d.ts +16 -0
  16. package/dist/components/EmptyState.d.ts.map +1 -0
  17. package/dist/components/EmptyState.js +31 -0
  18. package/dist/components/EmptyState.js.map +1 -0
  19. package/dist/components/EmptyState.stories.d.ts +15 -0
  20. package/dist/components/EmptyState.stories.d.ts.map +1 -0
  21. package/dist/components/EmptyState.stories.js +45 -0
  22. package/dist/components/EmptyState.stories.js.map +1 -0
  23. package/dist/components/ExpandableItem.d.ts +29 -0
  24. package/dist/components/ExpandableItem.d.ts.map +1 -0
  25. package/dist/components/ExpandableItem.js +28 -0
  26. package/dist/components/ExpandableItem.js.map +1 -0
  27. package/dist/components/ExpandableItem.stories.d.ts +14 -0
  28. package/dist/components/ExpandableItem.stories.d.ts.map +1 -0
  29. package/dist/components/ExpandableItem.stories.js +178 -0
  30. package/dist/components/ExpandableItem.stories.js.map +1 -0
  31. package/dist/components/ExpandableRow.d.ts +35 -0
  32. package/dist/components/ExpandableRow.d.ts.map +1 -0
  33. package/dist/components/ExpandableRow.js +69 -0
  34. package/dist/components/ExpandableRow.js.map +1 -0
  35. package/dist/components/InfoRow.d.ts +15 -0
  36. package/dist/components/InfoRow.d.ts.map +1 -0
  37. package/dist/components/InfoRow.js +27 -0
  38. package/dist/components/InfoRow.js.map +1 -0
  39. package/dist/components/MetricTile.d.ts +15 -0
  40. package/dist/components/MetricTile.d.ts.map +1 -0
  41. package/dist/components/MetricTile.js +32 -0
  42. package/dist/components/MetricTile.js.map +1 -0
  43. package/dist/components/PaginationBar.d.ts +17 -0
  44. package/dist/components/PaginationBar.d.ts.map +1 -0
  45. package/dist/components/PaginationBar.js +19 -0
  46. package/dist/components/PaginationBar.js.map +1 -0
  47. package/dist/components/SectionHeader.d.ts +15 -0
  48. package/dist/components/SectionHeader.d.ts.map +1 -0
  49. package/dist/components/SectionHeader.js +34 -0
  50. package/dist/components/SectionHeader.js.map +1 -0
  51. package/dist/components/SectionHeader.stories.d.ts +13 -0
  52. package/dist/components/SectionHeader.stories.d.ts.map +1 -0
  53. package/dist/components/SectionHeader.stories.js +32 -0
  54. package/dist/components/SectionHeader.stories.js.map +1 -0
  55. package/dist/components/SectionLabel.d.ts +10 -0
  56. package/dist/components/SectionLabel.d.ts.map +1 -0
  57. package/dist/components/SectionLabel.js +22 -0
  58. package/dist/components/SectionLabel.js.map +1 -0
  59. package/dist/components/SplitDivider.d.ts +13 -0
  60. package/dist/components/SplitDivider.d.ts.map +1 -0
  61. package/dist/components/SplitDivider.js +70 -0
  62. package/dist/components/SplitDivider.js.map +1 -0
  63. package/dist/components/SplitDivider.stories.d.ts +12 -0
  64. package/dist/components/SplitDivider.stories.d.ts.map +1 -0
  65. package/dist/components/SplitDivider.stories.js +62 -0
  66. package/dist/components/SplitDivider.stories.js.map +1 -0
  67. package/dist/components/StatusDot.d.ts +11 -0
  68. package/dist/components/StatusDot.d.ts.map +1 -0
  69. package/dist/components/StatusDot.js +21 -0
  70. package/dist/components/StatusDot.js.map +1 -0
  71. package/dist/components/index.d.ts +27 -0
  72. package/dist/components/index.d.ts.map +1 -0
  73. package/dist/components/index.js +14 -0
  74. package/dist/components/index.js.map +1 -0
  75. package/dist/components/sidebar/Sidebar.d.ts +21 -0
  76. package/dist/components/sidebar/Sidebar.d.ts.map +1 -0
  77. package/dist/components/sidebar/Sidebar.js +41 -0
  78. package/dist/components/sidebar/Sidebar.js.map +1 -0
  79. package/dist/components/sidebar/Sidebar.stories.d.ts +14 -0
  80. package/dist/components/sidebar/Sidebar.stories.d.ts.map +1 -0
  81. package/dist/components/sidebar/Sidebar.stories.js +92 -0
  82. package/dist/components/sidebar/Sidebar.stories.js.map +1 -0
  83. package/dist/components/sidebar/SidebarIcons.d.ts +25 -0
  84. package/dist/components/sidebar/SidebarIcons.d.ts.map +1 -0
  85. package/dist/components/sidebar/SidebarIcons.js +65 -0
  86. package/dist/components/sidebar/SidebarIcons.js.map +1 -0
  87. package/dist/components/sidebar/SidebarPanel.d.ts +13 -0
  88. package/dist/components/sidebar/SidebarPanel.d.ts.map +1 -0
  89. package/dist/components/sidebar/SidebarPanel.js +32 -0
  90. package/dist/components/sidebar/SidebarPanel.js.map +1 -0
  91. package/dist/components/sidebar/index.d.ts +7 -0
  92. package/dist/components/sidebar/index.d.ts.map +1 -0
  93. package/dist/components/sidebar/index.js +4 -0
  94. package/dist/components/sidebar/index.js.map +1 -0
  95. package/dist/hooks/index.d.ts +5 -0
  96. package/dist/hooks/index.d.ts.map +1 -0
  97. package/dist/hooks/index.js +3 -0
  98. package/dist/hooks/index.js.map +1 -0
  99. package/dist/hooks/useResize.d.ts +28 -0
  100. package/dist/hooks/useResize.d.ts.map +1 -0
  101. package/dist/hooks/useResize.js +39 -0
  102. package/dist/hooks/useResize.js.map +1 -0
  103. package/dist/hooks/useToggle.d.ts +17 -0
  104. package/dist/hooks/useToggle.d.ts.map +1 -0
  105. package/dist/hooks/useToggle.js +14 -0
  106. package/dist/hooks/useToggle.js.map +1 -0
  107. package/dist/index.d.ts +15 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +18 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/locales/en-US.d.ts +11 -0
  112. package/dist/locales/en-US.d.ts.map +1 -0
  113. package/dist/locales/en-US.js +11 -0
  114. package/dist/locales/en-US.js.map +1 -0
  115. package/dist/locales/index.d.ts +28 -0
  116. package/dist/locales/index.d.ts.map +1 -0
  117. package/dist/locales/index.js +10 -0
  118. package/dist/locales/index.js.map +1 -0
  119. package/dist/locales/zh-CN.d.ts +11 -0
  120. package/dist/locales/zh-CN.d.ts.map +1 -0
  121. package/dist/locales/zh-CN.js +11 -0
  122. package/dist/locales/zh-CN.js.map +1 -0
  123. package/dist/styles/card.d.ts +12 -0
  124. package/dist/styles/card.d.ts.map +1 -0
  125. package/dist/styles/card.js +39 -0
  126. package/dist/styles/card.js.map +1 -0
  127. package/dist/styles/empty-text.d.ts +7 -0
  128. package/dist/styles/empty-text.d.ts.map +1 -0
  129. package/dist/styles/empty-text.js +13 -0
  130. package/dist/styles/empty-text.js.map +1 -0
  131. package/dist/styles/expandable.d.ts +12 -0
  132. package/dist/styles/expandable.d.ts.map +1 -0
  133. package/dist/styles/expandable.js +34 -0
  134. package/dist/styles/expandable.js.map +1 -0
  135. package/dist/styles/index.d.ts +5 -0
  136. package/dist/styles/index.d.ts.map +1 -0
  137. package/dist/styles/index.js +5 -0
  138. package/dist/styles/index.js.map +1 -0
  139. package/dist/styles/metric.d.ts +12 -0
  140. package/dist/styles/metric.d.ts.map +1 -0
  141. package/dist/styles/metric.js +26 -0
  142. package/dist/styles/metric.js.map +1 -0
  143. package/dist/utils/avatar-color.d.ts +32 -0
  144. package/dist/utils/avatar-color.d.ts.map +1 -0
  145. package/dist/utils/avatar-color.js +31 -0
  146. package/dist/utils/avatar-color.js.map +1 -0
  147. package/dist/utils/fonts.d.ts +6 -0
  148. package/dist/utils/fonts.d.ts.map +1 -0
  149. package/dist/utils/fonts.js +6 -0
  150. package/dist/utils/fonts.js.map +1 -0
  151. package/dist/utils/format.d.ts +32 -0
  152. package/dist/utils/format.d.ts.map +1 -0
  153. package/dist/utils/format.js +75 -0
  154. package/dist/utils/format.js.map +1 -0
  155. package/dist/utils/pagination.d.ts +6 -0
  156. package/dist/utils/pagination.d.ts.map +1 -0
  157. package/dist/utils/pagination.js +6 -0
  158. package/dist/utils/pagination.js.map +1 -0
  159. package/package.json +80 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionLabel.js","sourceRoot":"","sources":["../../src/components/SectionLabel.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAOrC,6DAA6D;AAC7D,MAAM,UAAU,GAAG,CAAC,KAAkC,EAAE,EAAE,CAAC,GAAG,CAAA;eAC/C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;iBAChB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ;WAChC,KAAK,CAAC,KAAK,CAAC,aAAa;;;mBAGjB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAqB;IAC1D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,OAAO,cAAK,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,YAAG,QAAQ,GAAO,CAAC;AACvD,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface SplitDividerProps {
2
+ /** Called when drag ends with new sidebar width. */
3
+ onResize: (width: number) => void;
4
+ /** Disable drag interaction. */
5
+ disabled?: boolean;
6
+ /** Min pane width (default: 160). */
7
+ minWidth?: number;
8
+ /** Max pane width (default: window.innerWidth * 0.85). */
9
+ maxWidth?: number;
10
+ }
11
+ /** Renders a 4px draggable vertical divider. */
12
+ export declare function SplitDivider({ onResize, disabled, minWidth, maxWidth, }: SplitDividerProps): import("@emotion/react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=SplitDivider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitDivider.d.ts","sourceRoot":"","sources":["../../src/components/SplitDivider.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAgB,EAChB,QAAc,EACd,QAA0E,GAC3E,EAAE,iBAAiB,oDAiFnB"}
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { useTheme } from '@agentskillmania/skill-ui-theme';
3
+ import { css } from '@emotion/react';
4
+ import { useCallback, useEffect, useRef } from 'react';
5
+ /** Renders a 4px draggable vertical divider. */
6
+ export function SplitDivider({ onResize, disabled = false, minWidth = 160, maxWidth = typeof window !== 'undefined' ? window.innerWidth * 0.85 : 1200, }) {
7
+ const theme = useTheme();
8
+ // UI12: drag state lives in refs so the effect can read the latest values
9
+ // without re-registering listeners on every change. The effect cleanup
10
+ // guarantees listeners are removed on unmount even if mouseup never fires.
11
+ const dragState = useRef(null);
12
+ const handleMouseDown = useCallback((e) => {
13
+ if (disabled)
14
+ return;
15
+ const divider = e.currentTarget;
16
+ const sidebar = divider.nextElementSibling;
17
+ if (!sidebar)
18
+ return;
19
+ sidebar.classList.add('dragging');
20
+ document.body.style.cursor = 'col-resize';
21
+ dragState.current = {
22
+ sidebar,
23
+ startX: e.clientX,
24
+ startWidth: sidebar.offsetWidth,
25
+ };
26
+ }, [disabled]);
27
+ useEffect(() => {
28
+ const handleMouseMove = (ev) => {
29
+ const ds = dragState.current;
30
+ if (!ds?.sidebar)
31
+ return;
32
+ const delta = ds.startX - ev.clientX;
33
+ const newWidth = Math.max(minWidth, Math.min(maxWidth, ds.startWidth + delta));
34
+ ds.sidebar.style.width = `${newWidth}px`;
35
+ };
36
+ const handleMouseUp = () => {
37
+ const ds = dragState.current;
38
+ if (!ds?.sidebar)
39
+ return;
40
+ document.body.style.cursor = '';
41
+ ds.sidebar.classList.remove('dragging');
42
+ onResize(ds.sidebar.offsetWidth);
43
+ dragState.current = null;
44
+ };
45
+ document.addEventListener('mousemove', handleMouseMove);
46
+ document.addEventListener('mouseup', handleMouseUp);
47
+ return () => {
48
+ document.removeEventListener('mousemove', handleMouseMove);
49
+ document.removeEventListener('mouseup', handleMouseUp);
50
+ // Restore cursor if unmounting mid-drag
51
+ if (dragState.current) {
52
+ document.body.style.cursor = '';
53
+ dragState.current.sidebar?.classList.remove('dragging');
54
+ dragState.current = null;
55
+ }
56
+ };
57
+ }, [onResize, minWidth, maxWidth]);
58
+ return (_jsx("div", { onMouseDown: handleMouseDown, css: css `
59
+ width: 4px;
60
+ background: transparent;
61
+ cursor: ${disabled ? 'default' : 'col-resize'};
62
+ position: relative;
63
+ flex-shrink: 0;
64
+ transition: background ${theme.motion.duration.fast};
65
+ &:hover {
66
+ background: ${disabled ? 'transparent' : theme.color.borderHover};
67
+ }
68
+ ` }));
69
+ }
70
+ //# sourceMappingURL=SplitDivider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitDivider.js","sourceRoot":"","sources":["../../src/components/SplitDivider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAavD,gDAAgD;AAChD,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,GAAG,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,SAAS,CAAC,CAAC,CAAC,YAAY;;;iCAGpB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI;;wBAEnC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW;;OAEnE,GACD,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
+ import { SplitDivider } from './SplitDivider.js';
4
+ import type { SplitDividerProps } from './SplitDivider.js';
5
+ declare const meta: Meta<typeof SplitDivider>;
6
+ export default meta;
7
+ type Story = StoryObj<SplitDividerProps>;
8
+ /** Default split layout with a draggable divider between left and right panels. */
9
+ export declare const Default: Story;
10
+ /** Disabled divider — no drag interaction, appears as a static separator. */
11
+ export declare const Disabled: Story;
12
+ //# sourceMappingURL=SplitDivider.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitDivider.stories.d.ts","sourceRoot":"","sources":["../../src/components/SplitDivider.stories.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAInC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEzC,mFAAmF;AACnF,eAAO,MAAM,OAAO,EAAE,KAuDrB,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,QAAQ,EAAE,KAoCtB,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { css, useTheme } from '@emotion/react';
3
+ import { useState } from 'react';
4
+ import { SplitDivider } from './SplitDivider.js';
5
+ const meta = {
6
+ title: 'Shared/SplitDivider',
7
+ component: SplitDivider,
8
+ tags: ['autodocs'],
9
+ };
10
+ export default meta;
11
+ /** Default split layout with a draggable divider between left and right panels. */
12
+ export const Default = {
13
+ render: () => {
14
+ // eslint-disable-next-line react-hooks/rules-of-hooks
15
+ const [rightWidth, setRightWidth] = useState(280);
16
+ const theme = useTheme();
17
+ return (_jsxs("div", { css: css `
18
+ height: 300px;
19
+ display: flex;
20
+ border: 1px solid ${theme.color.border};
21
+ border-radius: ${theme.radius.md};
22
+ overflow: hidden;
23
+ `, children: [_jsxs("div", { css: css `
24
+ flex: 1;
25
+ background: ${theme.color.fillSecondary};
26
+ padding: ${theme.spacing[4]};
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: ${theme.spacing[2]};
30
+ `, children: [_jsx("span", { css: css `font-size: ${theme.font.size.base}; font-weight: ${theme.font.weight.semibold};`, children: "Left Panel" }), _jsx("span", { css: css `font-size: ${theme.font.size.sm}; color: ${theme.color.textSecondary};`, children: "This panel takes remaining space. Drag the divider to resize." })] }), _jsx(SplitDivider, { onResize: setRightWidth }), _jsxs("div", { css: css `
31
+ width: ${rightWidth}px;
32
+ background: ${theme.color.bgBase};
33
+ padding: ${theme.spacing[4]};
34
+ display: flex;
35
+ flex-direction: column;
36
+ gap: ${theme.spacing[2]};
37
+ overflow: hidden;
38
+ `, children: [_jsx("span", { css: css `font-size: ${theme.font.size.base}; font-weight: ${theme.font.weight.semibold};`, children: "Right Panel" }), _jsxs("span", { css: css `font-size: ${theme.font.size.sm}; color: ${theme.color.textSecondary};`, children: ["Width: ", rightWidth, "px"] })] })] }));
39
+ },
40
+ };
41
+ /** Disabled divider — no drag interaction, appears as a static separator. */
42
+ export const Disabled = {
43
+ render: () => {
44
+ const theme = useTheme();
45
+ return (_jsxs("div", { css: css `
46
+ height: 300px;
47
+ display: flex;
48
+ border: 1px solid ${theme.color.border};
49
+ border-radius: ${theme.radius.md};
50
+ overflow: hidden;
51
+ `, children: [_jsx("div", { css: css `
52
+ flex: 1;
53
+ background: ${theme.color.fillSecondary};
54
+ padding: ${theme.spacing[4]};
55
+ `, children: _jsx("span", { css: css `font-size: ${theme.font.size.base};`, children: "Left Panel" }) }), _jsx(SplitDivider, { onResize: () => { }, disabled: true }), _jsx("div", { css: css `
56
+ width: 200px;
57
+ background: ${theme.color.bgBase};
58
+ padding: ${theme.spacing[4]};
59
+ `, children: _jsx("span", { css: css `font-size: ${theme.font.size.base};`, children: "Right Panel" }) })] }));
60
+ },
61
+ };
62
+ //# sourceMappingURL=SplitDivider.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitDivider.stories.js","sourceRoot":"","sources":["../../src/components/SplitDivider.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,IAAI,GAA8B;IACtC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,mFAAmF;AACnF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,MAAM,EAAE,GAAG,EAAE;QACX,sDAAsD;QACtD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;QAEzB,OAAO,CACL,eACE,GAAG,EAAE,GAAG,CAAA;;;8BAGc,KAAK,CAAC,KAAK,CAAC,MAAM;2BACrB,KAAK,CAAC,MAAM,CAAC,EAAE;;SAEjC,aAED,eACE,GAAG,EAAE,GAAG,CAAA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C,EAAE;;SAEjC,aAED,cACE,GAAG,EAAE,GAAG,CAAA;;0BAEQ,KAAK,CAAC,KAAK,CAAC,aAAa;uBAC5B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;WAC5B,YAED,eAAM,GAAG,EAAE,GAAG,CAAA,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,2BAAmB,GAClE,EACN,KAAC,YAAY,IAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,QAAQ,SAAG,EAC7C,cACE,GAAG,EAAE,GAAG,CAAA;;0BAEQ,KAAK,CAAC,KAAK,CAAC,MAAM;uBACrB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;WAC5B,YAED,eAAM,GAAG,EAAE,GAAG,CAAA,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,4BAAoB,GACnE,IACF,CACP,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Props for the StatusDot component. */
2
+ export interface StatusDotProps {
3
+ /** Whether the status is active/enabled. Defaults to true. */
4
+ enabled?: boolean;
5
+ }
6
+ /**
7
+ * StatusDot — small colored circle indicating enabled/disabled state.
8
+ * Green for enabled, muted gray for disabled.
9
+ */
10
+ export declare function StatusDot({ enabled }: StatusDotProps): import("@emotion/react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=StatusDot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusDot.d.ts","sourceRoot":"","sources":["../../src/components/StatusDot.tsx"],"names":[],"mappings":"AAIA,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAWD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,OAAc,EAAE,EAAE,cAAc,oDAG3D"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { useTheme } from '@agentskillmania/skill-ui-theme';
4
+ import { css } from '@emotion/react';
5
+ /** Status dot style — 5px circle indicating enabled/disabled state. */
6
+ const dotStyle = (theme, enabled) => css `
7
+ width: 5px;
8
+ height: 5px;
9
+ border-radius: 50%;
10
+ flex-shrink: 0;
11
+ background: ${enabled ? theme.color.success : theme.color.textQuaternary};
12
+ `;
13
+ /**
14
+ * StatusDot — small colored circle indicating enabled/disabled state.
15
+ * Green for enabled, muted gray for disabled.
16
+ */
17
+ export function StatusDot({ enabled = true }) {
18
+ const theme = useTheme();
19
+ return _jsx("div", { css: dotStyle(theme, enabled) });
20
+ }
21
+ //# sourceMappingURL=StatusDot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusDot.js","sourceRoot":"","sources":["../../src/components/StatusDot.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAQrC,uEAAuE;AACvE,MAAM,QAAQ,GAAG,CAAC,KAAkC,EAAE,OAAgB,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;gBAK9D,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc;CACzE,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,EAAkB;IAC1D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,OAAO,cAAK,GAAG,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,GAAI,CAAC;AAChD,CAAC"}
@@ -0,0 +1,27 @@
1
+ export { SectionHeader } from './SectionHeader.js';
2
+ export type { SectionHeaderProps } from './SectionHeader.js';
3
+ export { EmptyState } from './EmptyState.js';
4
+ export type { EmptyStateProps } from './EmptyState.js';
5
+ export { ExpandableItem } from './ExpandableItem.js';
6
+ export type { ExpandableItemProps, ExpandableItemContext } from './ExpandableItem.js';
7
+ export { CollapsibleCard } from './CollapsibleCard.js';
8
+ export type { CollapsibleCardProps } from './CollapsibleCard.js';
9
+ export { SplitDivider } from './SplitDivider.js';
10
+ export type { SplitDividerProps } from './SplitDivider.js';
11
+ export { Sidebar, SidebarPanel, SidebarIcons } from './sidebar/index.js';
12
+ export type { SidebarProps, SidebarPanelProps, SidebarIconsProps, SidebarIconItem, } from './sidebar/index.js';
13
+ export { MetricTile } from './MetricTile.js';
14
+ export type { MetricTileProps } from './MetricTile.js';
15
+ export { SectionLabel } from './SectionLabel.js';
16
+ export type { SectionLabelProps } from './SectionLabel.js';
17
+ export { StatusDot } from './StatusDot.js';
18
+ export type { StatusDotProps } from './StatusDot.js';
19
+ export { CopyValue } from './CopyValue.js';
20
+ export type { CopyValueProps } from './CopyValue.js';
21
+ export { InfoRow } from './InfoRow.js';
22
+ export type { InfoRowProps } from './InfoRow.js';
23
+ export { ExpandableRow } from './ExpandableRow.js';
24
+ export type { ExpandableRowProps, DetailVariant } from './ExpandableRow.js';
25
+ export { PaginationBar } from './PaginationBar.js';
26
+ export type { PaginationBarProps } from './PaginationBar.js';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export { SectionHeader } from './SectionHeader.js';
2
+ export { EmptyState } from './EmptyState.js';
3
+ export { ExpandableItem } from './ExpandableItem.js';
4
+ export { CollapsibleCard } from './CollapsibleCard.js';
5
+ export { SplitDivider } from './SplitDivider.js';
6
+ export { Sidebar, SidebarPanel, SidebarIcons } from './sidebar/index.js';
7
+ export { MetricTile } from './MetricTile.js';
8
+ export { SectionLabel } from './SectionLabel.js';
9
+ export { StatusDot } from './StatusDot.js';
10
+ export { CopyValue } from './CopyValue.js';
11
+ export { InfoRow } from './InfoRow.js';
12
+ export { ExpandableRow } from './ExpandableRow.js';
13
+ export { PaginationBar } from './PaginationBar.js';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { SidebarIconItem } from './SidebarIcons.js';
3
+ export interface SidebarProps {
4
+ /** Sidebar width in pixels (ignored when collapsed). */
5
+ width: number;
6
+ /** Whether sidebar is collapsed to icon-only. */
7
+ isCollapsed: boolean;
8
+ /** Currently active panel key. */
9
+ activePanel: string;
10
+ /** Icon items for the icon bar. */
11
+ items?: SidebarIconItem[];
12
+ /** Toggle collapse/expand. */
13
+ onToggleCollapse: () => void;
14
+ /** Switch active panel. */
15
+ onSwitchPanel: (panel: string) => void;
16
+ /** Panel content (wrapped in SidebarPanel). */
17
+ children: ReactNode;
18
+ }
19
+ /** Renders a right-side collapsible sidebar with panel content and icon bar. */
20
+ export declare const Sidebar: import("react").NamedExoticComponent<SidebarProps>;
21
+ //# sourceMappingURL=Sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/Sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,WAAW,EAAE,OAAO,CAAC;IACrB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,8BAA8B;IAC9B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,2BAA2B;IAC3B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,gFAAgF;AAChF,eAAO,MAAM,OAAO,oDA+DlB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useTheme } from '@agentskillmania/skill-ui-theme';
3
+ import { css } from '@emotion/react';
4
+ import { memo } from 'react';
5
+ import { SidebarIcons } from './SidebarIcons.js';
6
+ /** Renders a right-side collapsible sidebar with panel content and icon bar. */
7
+ export const Sidebar = memo(function Sidebar({ width, isCollapsed, activePanel, items = [], onToggleCollapse, onSwitchPanel, children, }) {
8
+ const theme = useTheme();
9
+ return (_jsxs("div", { className: isCollapsed ? 'collapsed' : '', css: css `
10
+ display: flex;
11
+ border-left: 1px solid ${theme.color.border};
12
+ background: ${theme.color.bgBase};
13
+ overflow: hidden;
14
+ width: ${isCollapsed ? '42px' : `${width}px`};
15
+ min-width: ${isCollapsed ? '42px' : '160px'};
16
+ transition: width ${theme.motion.duration.normal} ${theme.motion.easing.out};
17
+ &.dragging {
18
+ transition: none;
19
+ }
20
+ `, children: [_jsx("div", { css: css `
21
+ flex: 1;
22
+ display: flex;
23
+ flex-direction: column;
24
+ overflow: hidden;
25
+ transition:
26
+ opacity ${theme.motion.duration.fast} ${theme.motion.easing.out},
27
+ transform ${theme.motion.duration.fast} ${theme.motion.easing.out};
28
+ ${isCollapsed
29
+ ? css `
30
+ opacity: 0;
31
+ transform: translateX(${theme.spacing[3]});
32
+ pointer-events: none;
33
+ width: 0;
34
+ `
35
+ : css `
36
+ opacity: 1;
37
+ transform: translateX(0);
38
+ `}
39
+ `, children: children }), _jsx(SidebarIcons, { items: items, activeId: activePanel, isCollapsed: isCollapsed, onToggleCollapse: onToggleCollapse, onSwitchPanel: onSwitchPanel })] }));
40
+ });
41
+ //# sourceMappingURL=Sidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../../src/components/sidebar/Sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAoBjD,gFAAgF;AAChF,MAAM,CAAC,MAAM,O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 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
+ import { Sidebar } from './Sidebar.js';
4
+ import type { SidebarProps } from './Sidebar.js';
5
+ declare const meta: Meta<typeof Sidebar>;
6
+ export default meta;
7
+ type Story = StoryObj<SidebarProps>;
8
+ /** Fully expanded sidebar with panel content and icon bar. */
9
+ export declare const Expanded: Story;
10
+ /** Collapsed sidebar — only icon bar visible, panel content hidden. */
11
+ export declare const Collapsed: Story;
12
+ /** Fully interactive sidebar with collapse toggle, panel switching, and a split layout. */
13
+ export declare const Interactive: Story;
14
+ //# sourceMappingURL=Sidebar.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/Sidebar.stories.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAgB9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAuDpC,8DAA8D;AAC9D,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,SAAS,EAAE,KAevB,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,WAAW,EAAE,KA4DzB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { css, useTheme } from '@emotion/react';
3
+ import { useState } from 'react';
4
+ import { Activity, Terminal, Wrench, FileText } from 'lucide-react';
5
+ import { Sidebar } from './Sidebar.js';
6
+ import { SidebarPanel } from './SidebarPanel.js';
7
+ import { SplitDivider } from '../SplitDivider.js';
8
+ const meta = {
9
+ title: 'Shared/Sidebar',
10
+ component: Sidebar,
11
+ tags: ['autodocs'],
12
+ argTypes: {
13
+ items: { control: false },
14
+ onToggleCollapse: { control: false },
15
+ onSwitchPanel: { control: false },
16
+ },
17
+ decorators: [
18
+ (Story) => (_jsx("div", { style: { height: '500px', display: 'flex', justifyContent: 'flex-end' }, children: _jsx(Story, {}) })),
19
+ ],
20
+ };
21
+ export default meta;
22
+ const sidebarItems = [
23
+ { id: 'event-log', icon: Activity, label: 'Event Log' },
24
+ { id: 'terminal', icon: Terminal, label: 'Terminal' },
25
+ { id: 'skills', icon: Wrench, label: 'Skills' },
26
+ { id: 'files', icon: FileText, label: 'Files' },
27
+ ];
28
+ /** Mock event log rows for panel content. */
29
+ function MockEventLogContent() {
30
+ const theme = useTheme();
31
+ const events = [
32
+ { id: '1', label: 'Agent started', time: '10:01:23', status: 'ok' },
33
+ { id: '2', label: 'Executed ReadFile', time: '10:01:25', status: 'ok' },
34
+ { id: '3', label: 'Retry attempt 2/3', time: '10:01:30', status: 'warn' },
35
+ { id: '4', label: 'Tool execution failed', time: '10:01:35', status: 'error' },
36
+ { id: '5', label: 'Session completed', time: '10:02:01', status: 'ok' },
37
+ ];
38
+ return (_jsx("div", { children: events.map((event) => (_jsxs("div", { css: css `
39
+ display: flex;
40
+ align-items: center;
41
+ gap: ${theme.spacing[2]};
42
+ padding: ${theme.spacing[1]} ${theme.spacing[3]};
43
+ font-size: ${theme.font.size.xs};
44
+ `, children: [_jsx("span", { css: css `
45
+ width: 6px;
46
+ height: 6px;
47
+ border-radius: 50%;
48
+ background: ${event.status === 'ok'
49
+ ? theme.color.success
50
+ : event.status === 'warn'
51
+ ? theme.color.warning
52
+ : theme.color.error};
53
+ flex-shrink: 0;
54
+ ` }), _jsx("span", { css: css `flex: 1; color: ${theme.color.text};`, children: event.label }), _jsx("span", { css: css `color: ${theme.color.textTertiary};`, children: event.time })] }, event.id))) }));
55
+ }
56
+ /** Fully expanded sidebar with panel content and icon bar. */
57
+ export const Expanded = {
58
+ render: () => {
59
+ // eslint-disable-next-line react-hooks/rules-of-hooks
60
+ const [activePanel, setActivePanel] = useState('event-log');
61
+ return (_jsx(Sidebar, { width: 320, isCollapsed: false, activePanel: activePanel, items: sidebarItems, onToggleCollapse: () => { }, onSwitchPanel: (id) => setActivePanel(id), children: _jsx(SidebarPanel, { title: "Event Log", icon: Activity, children: _jsx(MockEventLogContent, {}) }) }));
62
+ },
63
+ };
64
+ /** Collapsed sidebar — only icon bar visible, panel content hidden. */
65
+ export const Collapsed = {
66
+ render: () => (_jsx(Sidebar, { width: 320, isCollapsed: true, activePanel: "event-log", items: sidebarItems, onToggleCollapse: () => { }, onSwitchPanel: () => { }, children: _jsx(SidebarPanel, { title: "Event Log", icon: Activity, children: _jsx(MockEventLogContent, {}) }) })),
67
+ };
68
+ /** Fully interactive sidebar with collapse toggle, panel switching, and a split layout. */
69
+ export const Interactive = {
70
+ render: () => {
71
+ // eslint-disable-next-line react-hooks/rules-of-hooks
72
+ const [isCollapsed, setIsCollapsed] = useState(false);
73
+ const [activePanel, setActivePanel] = useState('event-log');
74
+ const [sidebarWidth, setSidebarWidth] = useState(380);
75
+ const theme = useTheme();
76
+ return (_jsxs("div", { css: css `
77
+ height: 500px;
78
+ display: flex;
79
+ border: 1px solid ${theme.color.border};
80
+ border-radius: ${theme.radius.md};
81
+ overflow: hidden;
82
+ `, children: [_jsxs("div", { css: css `
83
+ flex: 1;
84
+ background: ${theme.color.fillSecondary};
85
+ padding: ${theme.spacing[4]};
86
+ display: flex;
87
+ flex-direction: column;
88
+ gap: ${theme.spacing[2]};
89
+ `, children: [_jsx("span", { css: css `font-size: ${theme.font.size.base}; font-weight: ${theme.font.weight.semibold};`, children: "Main Content" }), _jsx("span", { css: css `font-size: ${theme.font.size.sm}; color: ${theme.color.textSecondary};`, children: "Use the divider to resize. Click icons to switch panels." }), _jsxs("span", { css: css `font-size: ${theme.font.size.xs}; color: ${theme.color.textTertiary};`, children: ["Active panel: ", activePanel, " | Sidebar width: ", sidebarWidth, "px | Collapsed: ", isCollapsed ? 'yes' : 'no'] })] }), _jsx(SplitDivider, { onResize: setSidebarWidth, disabled: isCollapsed }), _jsx(Sidebar, { width: sidebarWidth, isCollapsed: isCollapsed, activePanel: activePanel, items: sidebarItems, onToggleCollapse: () => setIsCollapsed((prev) => !prev), onSwitchPanel: (id) => setActivePanel(id), children: _jsx(SidebarPanel, { title: "Event Log", icon: Activity, children: _jsx(MockEventLogContent, {}) }) })] }));
90
+ },
91
+ };
92
+ //# sourceMappingURL=Sidebar.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.stories.js","sourceRoot":"","sources":["../../../src/components/sidebar/Sidebar.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,IAAI,GAAyB;IACjC,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;QACzB,gBAAgB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;QACpC,aAAa,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;KAClC;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,cAAK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C,OAAO,CAAC,CAAC,CAAC;WACxB,aAED,eAAM,GAAG,EAAE,GAAG,CAAA,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,kBAAkB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,6BAExF,EACP,eAAM,GAAG,EAAE,GAAG,CAAA,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,CAAC,KAAK,CAAC,aAAa,GAAG,yEAE/E,EACP,gBAAM,GAAG,EAAE,GAAG,CAAA,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,CAAC,KAAK,CAAC,YAAY,GAAG,+BACpE,WAAW,wBAAoB,YAAY,sBAAkB,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IACjG,IACH,EAEN,KAAC,YAAY,IACX,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,WAAW,GACrB,EAEF,KAAC,OAAO,IACN,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,YAAY,EACnB,gBAAgB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EACvD,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,YAEzC,KAAC,YAAY,IAAC,KAAK,EAAC,WAAW,EAAC,IAAI,EAAE,QAAQ,YAC5C,KAAC,mBAAmB,KAAG,GACV,GACP,IACN,CACP,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ /** Configuration for a single icon button in the bar. */
3
+ export interface SidebarIconItem {
4
+ /** Unique panel identifier. */
5
+ id: string;
6
+ /** Icon component to render. */
7
+ icon: LucideIcon;
8
+ /** Accessible label / tooltip text. */
9
+ label: string;
10
+ }
11
+ export interface SidebarIconsProps {
12
+ /** Icon items to display (excluding collapse button). */
13
+ items: SidebarIconItem[];
14
+ /** Currently active panel key. */
15
+ activeId: string;
16
+ /** Whether sidebar is collapsed. */
17
+ isCollapsed: boolean;
18
+ /** Toggle collapse/expand. */
19
+ onToggleCollapse: () => void;
20
+ /** Switch active panel. */
21
+ onSwitchPanel: (id: string) => void;
22
+ }
23
+ /** Renders a vertical icon bar with collapse toggle and panel switch buttons. */
24
+ export declare const SidebarIcons: import("react").NamedExoticComponent<SidebarIconsProps>;
25
+ //# sourceMappingURL=SidebarIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarIcons.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/SidebarIcons.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM/C,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,2BAA2B;IAC3B,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,iFAAiF;AACjF,eAAO,MAAM,YAAY,yDAqFvB,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useTheme } from '@agentskillmania/skill-ui-theme';
3
+ import { css } from '@emotion/react';
4
+ import { Tooltip } from 'antd';
5
+ import { ChevronLeft, ChevronRight } from 'lucide-react';
6
+ import { memo } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { NAMESPACE } from '../../locales/index.js';
9
+ /** Renders a vertical icon bar with collapse toggle and panel switch buttons. */
10
+ export const SidebarIcons = memo(function SidebarIcons({ items, activeId, isCollapsed, onToggleCollapse, onSwitchPanel, }) {
11
+ const theme = useTheme();
12
+ const { t } = useTranslation(NAMESPACE);
13
+ const CollapseIcon = isCollapsed ? ChevronRight : ChevronLeft;
14
+ return (_jsxs("div", { css: css `
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ padding: ${theme.spacing[2]} ${theme.spacing[1]};
19
+ gap: ${theme.spacing[1]};
20
+ border-left: 1px solid ${theme.color.border};
21
+ background: ${theme.color.fillSecondary};
22
+ flex-shrink: 0;
23
+ `, children: [_jsx(Tooltip, { title: isCollapsed ? t('sidebar.expand') : t('sidebar.collapse'), placement: "left", children: _jsx("button", { onClick: onToggleCollapse, css: css `
24
+ width: 32px;
25
+ height: 32px;
26
+ border-radius: ${theme.radius.md};
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ cursor: pointer;
31
+ background: transparent;
32
+ color: ${theme.color.textSecondary};
33
+ border: none;
34
+ transition:
35
+ background ${theme.motion.duration.fast},
36
+ color ${theme.motion.duration.fast};
37
+ &:hover {
38
+ background: ${theme.color.fillTertiary};
39
+ color: ${theme.color.text};
40
+ }
41
+ `, children: _jsx(CollapseIcon, { size: 18 }) }) }), items.map((item) => {
42
+ const isActive = item.id === activeId && !isCollapsed;
43
+ const Icon = item.icon;
44
+ return (_jsx(Tooltip, { title: item.label, placement: "left", children: _jsx("button", { onClick: () => onSwitchPanel(item.id), css: css `
45
+ width: 32px;
46
+ height: 32px;
47
+ border-radius: ${theme.radius.md};
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ cursor: pointer;
52
+ background: ${isActive ? theme.color.primaryBg : 'transparent'};
53
+ color: ${isActive ? theme.color.primary : theme.color.textSecondary};
54
+ border: none;
55
+ transition:
56
+ background ${theme.motion.duration.fast},
57
+ color ${theme.motion.duration.fast};
58
+ &:hover {
59
+ background: ${theme.color.fillTertiary};
60
+ color: ${theme.color.text};
61
+ }
62
+ `, children: _jsx(Icon, { size: 18 }) }) }, item.id));
63
+ })] }));
64
+ });
65
+ //# sourceMappingURL=SidebarIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarIcons.js","sourceRoot":"","sources":["../../../src/components/sidebar/SidebarIcons.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAyBnD,iFAAiF;AACjF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,YAAY,CAAC,EACrD,KAAK,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,aAAa,GACK;IAClB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;IAE9D,OAAO,CACL,eACE,GAAG,EAAE,GAAG,CAAA;;;;mBAIK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;eACxC,KAAK,CAAC,OA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CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa;;;+BAGpD,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI;0BAC/B,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI;;gCAEpB,KAAK,CAAC,KAAK,CAAC,YAAY;2BAC7B,KAAK,CAAC,KAAK,CAAC,IAAI;;eAE5B,YAED,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,GAAI,GACX,IAxBG,IAAI,CAAC,EAAE,CAyBX,CACX,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ReactNode } from 'react';
3
+ export interface SidebarPanelProps {
4
+ /** Panel title (rendered uppercase via CSS). */
5
+ title: string;
6
+ /** Panel icon. */
7
+ icon: LucideIcon;
8
+ /** Scrollable panel content. */
9
+ children: ReactNode;
10
+ }
11
+ /** Renders a panel with icon + uppercase title header and scrollable body. */
12
+ export declare const SidebarPanel: import("react").NamedExoticComponent<SidebarPanelProps>;
13
+ //# sourceMappingURL=SidebarPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/SidebarPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,8EAA8E;AAC9E,eAAO,MAAM,YAAY,yDAiDvB,CAAC"}