@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 yusangeng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @agentskillmania/skill-ui-shared
2
+
3
+ Shared UI components, hooks, and style presets for the @agentskillmania skill-ui ecosystem.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @agentskillmania/skill-ui-shared
9
+ ```
10
+
11
+ ## Components
12
+
13
+ | Component | Description |
14
+ |-----------|-------------|
15
+ | `Sidebar` | Right-side collapsible sidebar shell |
16
+ | `SidebarPanel` | Panel container with title bar + scrollable body |
17
+ | `SidebarIcons` | Vertical icon bar for panel switching |
18
+ | `CollapsibleCard` | antd Card (size="small") with collapse toggle |
19
+ | `SectionHeader` | Icon + uppercase label + bottom divider |
20
+ | `EmptyState` | Placeholder based on antd Empty |
21
+ | `ExpandableItem` | Headless expandable list item container |
22
+ | `SplitDivider` | 4px draggable vertical divider |
23
+
24
+ ## Hooks
25
+
26
+ | Hook | Description |
27
+ |------|-------------|
28
+ | `useToggle` | Boolean state with set/toggle/reset |
29
+ | `useResize` | Drag-based width resizing |
30
+
31
+ ## Style Presets
32
+
33
+ | Preset | Description |
34
+ |--------|-------------|
35
+ | `cardBodyTransition` | Card body collapse/expand animation |
36
+ | `cardHeaderInteractive` | Card header cursor + hover styles |
37
+ | `expandableDetailTransition` | Expandable detail area animation |
38
+ | `expandableSummaryHover` | Summary row hover styles |
39
+
40
+ ## i18n
41
+
42
+ Exports `NAMESPACE` (`skill-ui-shared`) and `resources` for zh-CN / en-US locales.
43
+
44
+ ## Peer Dependencies
45
+
46
+ - `@agentskillmania/skill-ui-theme`
47
+ - `react`, `react-dom`
48
+ - `antd` (^6.0.0)
49
+ - `lucide-react`
50
+ - `@emotion/react`
51
+ - `react-i18next`
@@ -0,0 +1,22 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export interface CollapsibleCardProps {
3
+ /** Card title — string or custom JSX (e.g. i18n text). */
4
+ title: ReactNode;
5
+ /** Uncontrolled initial collapse state. */
6
+ defaultCollapsed?: boolean;
7
+ /** Controlled collapse state. */
8
+ collapsed?: boolean;
9
+ /** Collapse state change callback. */
10
+ onCollapseChange?: (collapsed: boolean) => void;
11
+ /** Optional badge/tag in header (right side). */
12
+ badge?: ReactNode;
13
+ /** Collapsible content. */
14
+ children: ReactNode;
15
+ /** Additional className. */
16
+ className?: string;
17
+ /** Additional styles. */
18
+ style?: CSSProperties;
19
+ }
20
+ /** Renders a collapsible antd Card with title, optional badge, and toggle button. */
21
+ export declare const CollapsibleCard: import("react").NamedExoticComponent<CollapsibleCardProps>;
22
+ //# sourceMappingURL=CollapsibleCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleCard.d.ts","sourceRoot":"","sources":["../../src/components/CollapsibleCard.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI9E,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,KAAK,EAAE,SAAS,CAAC;IACjB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,iDAAiD;IACjD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,qFAAqF;AACrF,eAAO,MAAM,eAAe,4DAyD1B,CAAC"}
@@ -0,0 +1,30 @@
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 { Button, Card } from 'antd';
5
+ import { ChevronDown, ChevronRight } from 'lucide-react';
6
+ import { memo, useCallback } from 'react';
7
+ import { useToggle } from '../hooks/index.js';
8
+ /** Renders a collapsible antd Card with title, optional badge, and toggle button. */
9
+ export const CollapsibleCard = memo(function CollapsibleCard({ title, defaultCollapsed = false, collapsed: controlledCollapsed, onCollapseChange, badge, children, className, style, }) {
10
+ const theme = useTheme();
11
+ const toggle = useToggle(defaultCollapsed);
12
+ const isCollapsed = controlledCollapsed !== undefined ? controlledCollapsed : toggle.value;
13
+ const handleToggle = useCallback(() => {
14
+ const next = !isCollapsed;
15
+ toggle.set(next);
16
+ onCollapseChange?.(next);
17
+ }, [isCollapsed, onCollapseChange, toggle]);
18
+ return (_jsx(Card, { size: "small", className: className, style: style, title: title, extra: _jsxs("div", { css: css `
19
+ display: flex;
20
+ align-items: center;
21
+ gap: ${theme.spacing[2]};
22
+ `, children: [badge, _jsx(Button, { type: "text", size: "small", "data-testid": "collapse-toggle", onClick: handleToggle, css: css `
23
+ font-size: ${theme.font.size.xs};
24
+ color: ${theme.color.textTertiary};
25
+ padding: 0 ${theme.spacing[1]};
26
+ height: auto;
27
+ line-height: 1;
28
+ `, children: isCollapsed ? _jsx(ChevronRight, { size: 12 }) : _jsx(ChevronDown, { size: 12 }) })] }), children: !isCollapsed && children }));
29
+ });
30
+ //# sourceMappingURL=CollapsibleCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleCard.js","sourceRoot":"","sources":["../../src/components/CollapsibleCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAsC,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAqB9C,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,eAAe,CAAC,EAC3D,KAAK,EACL,gBAAgB,GAAG,KAAK,EACxB,SAAS,EAAE,mBAAmB,EAC9B,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,KAAK,GACgB;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,C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ybook/react-vite';
3
+ import { CollapsibleCard } from './CollapsibleCard.js';
4
+ import type { CollapsibleCardProps } from './CollapsibleCard.js';
5
+ declare const meta: Meta<typeof CollapsibleCard>;
6
+ export default meta;
7
+ type Story = StoryObj<CollapsibleCardProps>;
8
+ /** Expanded card showing session overview data. */
9
+ export declare const Expanded: Story;
10
+ /** Collapsed card — content hidden, only header visible. */
11
+ export declare const Collapsed: Story;
12
+ /** Card with a status badge in the header. */
13
+ export declare const WithBadge: Story;
14
+ /** Multiple cards stacked to demonstrate a dashboard-like layout. */
15
+ export declare const MultipleCards: Story;
16
+ //# sourceMappingURL=CollapsibleCard.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleCard.stories.d.ts","sourceRoot":"","sources":["../../src/components/CollapsibleCard.stories.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAItC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAqC5C,mDAAmD;AACnD,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,SAAS,EAAE,KAuBvB,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,aAAa,EAAE,KAkC3B,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { css, useTheme } from '@emotion/react';
3
+ import { CollapsibleCard } from './CollapsibleCard.js';
4
+ const meta = {
5
+ title: 'Shared/CollapsibleCard',
6
+ component: CollapsibleCard,
7
+ tags: ['autodocs'],
8
+ };
9
+ export default meta;
10
+ /** Helper to render a key-value row inside a card. */
11
+ function KVRow({ label, value }) {
12
+ const theme = useTheme();
13
+ return (_jsxs("div", { css: css `
14
+ display: flex;
15
+ justify-content: space-between;
16
+ padding: ${theme.spacing[1]} 0;
17
+ &:not(:last-child) {
18
+ border-bottom: 1px solid ${theme.color.borderSecondary};
19
+ }
20
+ `, children: [_jsx("span", { css: css `
21
+ font-size: ${theme.font.size.sm};
22
+ color: ${theme.color.textSecondary};
23
+ `, children: label }), _jsx("span", { css: css `
24
+ font-size: ${theme.font.size.sm};
25
+ color: ${theme.color.text};
26
+ font-weight: ${theme.font.weight.medium};
27
+ `, children: value })] }));
28
+ }
29
+ /** Expanded card showing session overview data. */
30
+ export const Expanded = {
31
+ render: () => (_jsxs(CollapsibleCard, { title: "Session Overview", defaultCollapsed: false, children: [_jsx(KVRow, { label: "Session ID", value: "sess-abc123" }), _jsx(KVRow, { label: "Agent", value: "Code Assistant" }), _jsx(KVRow, { label: "Status", value: "Running" }), _jsx(KVRow, { label: "Duration", value: "2m 34s" })] })),
32
+ };
33
+ /** Collapsed card — content hidden, only header visible. */
34
+ export const Collapsed = {
35
+ render: () => (_jsxs(CollapsibleCard, { title: "Session Overview", defaultCollapsed: true, children: [_jsx(KVRow, { label: "Session ID", value: "sess-abc123" }), _jsx(KVRow, { label: "Agent", value: "Code Assistant" })] })),
36
+ };
37
+ /** Card with a status badge in the header. */
38
+ export const WithBadge = {
39
+ render: () => (_jsxs(CollapsibleCard, { title: "Agent State", badge: _jsx("span", { style: {
40
+ fontSize: '11px',
41
+ padding: '1px 8px',
42
+ borderRadius: '4px',
43
+ background: 'rgba(67,97,238,0.08)',
44
+ color: '#4361ee',
45
+ }, children: "Running" }), children: [_jsx(KVRow, { label: "Model", value: "claude-sonnet-4" }), _jsx(KVRow, { label: "Tokens Used", value: "12,847" }), _jsx(KVRow, { label: "Tools Available", value: "8" })] })),
46
+ };
47
+ /** Multiple cards stacked to demonstrate a dashboard-like layout. */
48
+ export const MultipleCards = {
49
+ render: () => (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '12px' }, children: [_jsxs(CollapsibleCard, { title: "Session Overview", defaultCollapsed: false, children: [_jsx(KVRow, { label: "Session ID", value: "sess-abc123" }), _jsx(KVRow, { label: "Agent", value: "Code Assistant" }), _jsx(KVRow, { label: "Status", value: "Running" })] }), _jsxs(CollapsibleCard, { title: "Agent State", defaultCollapsed: true, children: [_jsx(KVRow, { label: "Model", value: "claude-sonnet-4" }), _jsx(KVRow, { label: "Tokens Used", value: "12,847" })] }), _jsxs(CollapsibleCard, { title: "Skills", defaultCollapsed: false, badge: _jsx("span", { style: {
50
+ fontSize: '11px',
51
+ padding: '1px 8px',
52
+ borderRadius: '4px',
53
+ background: 'rgba(34,197,94,0.08)',
54
+ color: '#16a34a',
55
+ }, children: "5 loaded" }), children: [_jsx(KVRow, { label: "Active Skills", value: "browse, code-review, ship" }), _jsx(KVRow, { label: "Last Updated", value: "2 hours ago" })] })] })),
56
+ };
57
+ //# sourceMappingURL=CollapsibleCard.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleCard.stories.js","sourceRoot":"","sources":["../../src/components/CollapsibleCard.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,IAAI,GAAiC;IACzC,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,sDAAsD;AACtD,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAoC;IAC/D,MAAM,KAAK,GAAG,QAAQ,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EAAC,iBAAiB,GAAG,EAC/C,KAAC,KAAK,IAAC,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,QAAQ,GAAG,IAC5B,EAClB,MAAC,eAAe,IACd,KAAK,EAAC,QAAQ,EACd,gBAAgB,EAAE,KAAK,EACvB,KAAK,EACH,eACE,KAAK,EAAE;wBACL,QAAQ,EAAE,MAAM;wBAChB,OAAO,EAAE,SAAS;wBAClB,YAAY,EAAE,KAAK;wBACnB,UAAU,EAAE,sBAAsB;wBAClC,KAAK,EAAE,SAAS;qBACjB,yBAGI,aAGT,KAAC,KAAK,IAAC,KAAK,EAAC,eAAe,EAAC,KAAK,EAAC,2BAA2B,GAAG,EACjE,KAAC,KAAK,IAAC,KAAK,EAAC,cAAc,EAAC,KAAK,EAAC,aAAa,GAAG,IAClC,IACd,CACP;CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Props for the CopyValue component. */
2
+ export interface CopyValueProps {
3
+ /** The text to copy to clipboard when clicked. */
4
+ text: string;
5
+ children: React.ReactNode;
6
+ }
7
+ /**
8
+ * CopyValue — click-to-copy value with tooltip and antd message feedback.
9
+ * Wraps the displayed value; clicking copies the `text` prop to clipboard.
10
+ */
11
+ export declare function CopyValue({ text, children }: CopyValueProps): import("@emotion/react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=CopyValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyValue.d.ts","sourceRoot":"","sources":["../../src/components/CopyValue.tsx"],"names":[],"mappings":"AAKA,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkBD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,cAAc,oDAuB3D"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { useTheme } from '@agentskillmania/skill-ui-theme';
4
+ import { css } from '@emotion/react';
5
+ import { Tooltip, message } from 'antd';
6
+ /** Click-to-copy value style. */
7
+ const valueStyle = (theme) => css `
8
+ color: ${theme.color.text};
9
+ text-align: right;
10
+ white-space: nowrap;
11
+ overflow: hidden;
12
+ text-overflow: ellipsis;
13
+ max-width: 60%;
14
+ cursor: pointer;
15
+ user-select: none;
16
+ transition: color 0.15s;
17
+ &:hover {
18
+ color: ${theme.color.primary};
19
+ }
20
+ `;
21
+ /**
22
+ * CopyValue — click-to-copy value with tooltip and antd message feedback.
23
+ * Wraps the displayed value; clicking copies the `text` prop to clipboard.
24
+ */
25
+ export function CopyValue({ text, children }) {
26
+ const theme = useTheme();
27
+ const [messageApi, contextHolder] = message.useMessage();
28
+ const handleClick = async () => {
29
+ try {
30
+ await navigator.clipboard.writeText(text);
31
+ messageApi.success('Copied', 1.2);
32
+ }
33
+ catch {
34
+ messageApi.error('Copy failed');
35
+ }
36
+ };
37
+ return (_jsxs(_Fragment, { children: [contextHolder, _jsx(Tooltip, { title: text, placement: "topRight", children: _jsx("span", { css: valueStyle(theme), onClick: handleClick, children: children }) })] }));
38
+ }
39
+ //# sourceMappingURL=CopyValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyValue.js","sourceRoot":"","sources":["../../src/components/CopyValue.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AASxC,iCAAiC;AACjC,MAAM,UAAU,GAAG,CAAC,KAAkC,EAAE,EAAE,CAAC,GAAG,CAAA;WACnD,KAAK,CAAC,KAAK,CAAC,IAAI;;;;;;;;;;aAUd,KAAK,CAAC,KAAK,CAAC,OAAO;;CAE/B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAkB;IAC1D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAEzD,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;QAC7B,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC1C,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,8BACG,aAAa,EACd,KAAC,OAAO,IAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,UAAU,YACxC,eAAM,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,WAAW,YAC/C,QAAQ,GACJ,GACC,IACT,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface EmptyStateProps {
3
+ /** Primary message. */
4
+ title?: string;
5
+ /** Secondary explanation. */
6
+ description?: string;
7
+ /** Custom icon/illustration. */
8
+ icon?: ReactNode;
9
+ /** CTA element (e.g. button). */
10
+ action?: ReactNode;
11
+ /** Reduced padding for inline use. */
12
+ compact?: boolean;
13
+ }
14
+ /** Renders an empty state placeholder with optional title, description, and action. */
15
+ export declare function EmptyState({ title, description, icon, action, compact }: EmptyStateProps): import("@emotion/react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=EmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iCAAiC;IACjC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAe,EAAE,EAAE,eAAe,oDAsDhG"}
@@ -0,0 +1,31 @@
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 { Empty } from 'antd';
5
+ /** Renders an empty state placeholder with optional title, description, and action. */
6
+ export function EmptyState({ title, description, icon, action, compact = false }) {
7
+ const theme = useTheme();
8
+ return (_jsxs("div", { css: css `
9
+ display: flex;
10
+ flex-direction: ${compact ? 'row' : 'column'};
11
+ align-items: center;
12
+ justify-content: center;
13
+ ${compact
14
+ ? `gap: ${theme.spacing[1]}; padding: ${theme.spacing[4]} ${theme.spacing[2]};`
15
+ : `gap: ${theme.spacing[2]}; padding: ${theme.spacing[8]} ${theme.spacing[4]};`}
16
+ text-align: center;
17
+ `, children: [icon ? (_jsx("div", { css: css `
18
+ font-size: ${compact ? '20px' : '36px'};
19
+ opacity: 0.4;
20
+ `, children: icon })) : (_jsx(Empty, { image: Empty.PRESENTED_IMAGE_DEFAULT, description: null })), title && (_jsx("div", { css: css `
21
+ font-size: ${theme.font.size.base};
22
+ font-weight: ${theme.font.weight.medium};
23
+ color: ${theme.color.textSecondary};
24
+ `, children: title })), description && (_jsx("div", { css: css `
25
+ font-size: ${theme.font.size.sm};
26
+ color: ${theme.color.textTertiary};
27
+ max-width: 240px;
28
+ line-height: 1.5;
29
+ `, children: description })), action && _jsx("div", { children: action })] }));
30
+ }
31
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAgB7B,uFAAuF;AACvF,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAmB;IAC/F,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACL,eACE,GAAG,EAAE,GAAG,CAAA;;0BAEY,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;;;UAG1C,OAAO;YACP,CAAC,CAAC,QAAQ,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;YAC/E,CAAC,CAAC,QAAQ,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;;OAElF,aAEA,IAAI,CAAC,CAAC,CAAC,CACN,cACE,GAAG,EAAE,GAAG,CAAA;yBACO,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;;WAEvC,YAEA,IAAI,GACD,CACP,CAAC,CAAC,CAAC,CACF,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,uBAAuB,EAAE,WAAW,EAAE,IAAI,GAAI,CACnE,EACA,KAAK,IAAI,CACR,cACE,GAAG,EAAE,GAAG,CAAA;yBACO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;2BAClB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;qBAC9B,KAAK,CAAC,KAAK,CAAC,aAAa;WACnC,YAEA,KAAK,GACF,CACP,EACA,WAAW,IAAI,CACd,cACE,GAAG,EAAE,GAAG,CAAA;yBACO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;qBACtB,KAAK,CAAC,KAAK,CAAC,YAAY;;;WAGlC,YAEA,WAAW,GACR,CACP,EACA,MAAM,IAAI,wBAAM,MAAM,GAAO,IAC1B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { EmptyState } from './EmptyState.js';
3
+ import type { EmptyStateProps } from './EmptyState.js';
4
+ declare const meta: Meta<typeof EmptyState>;
5
+ export default meta;
6
+ type Story = StoryObj<EmptyStateProps>;
7
+ /** Default empty state with title and description. */
8
+ export declare const Default: Story;
9
+ /** Empty state with a call-to-action button. */
10
+ export declare const WithAction: Story;
11
+ /** Compact inline variant with reduced padding and horizontal layout. */
12
+ export declare const Compact: Story;
13
+ /** Empty state with a custom icon instead of the default antd Empty. */
14
+ export declare const CustomIcon: Story;
15
+ //# sourceMappingURL=EmptyState.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.stories.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAIjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAEvC,sDAAsD;AACtD,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { EmptyState } from './EmptyState.js';
3
+ const meta = {
4
+ title: 'Shared/EmptyState',
5
+ component: EmptyState,
6
+ tags: ['autodocs'],
7
+ };
8
+ export default meta;
9
+ /** Default empty state with title and description. */
10
+ export const Default = {
11
+ args: {
12
+ title: 'No Data',
13
+ description: 'There are no items to display.',
14
+ },
15
+ };
16
+ /** Empty state with a call-to-action button. */
17
+ export const WithAction = {
18
+ args: {
19
+ title: 'No Sessions',
20
+ description: 'Start a new session to begin.',
21
+ action: (_jsx("button", { style: {
22
+ padding: '4px 16px',
23
+ borderRadius: '6px',
24
+ background: '#4361ee',
25
+ color: '#fff',
26
+ border: 'none',
27
+ cursor: 'pointer',
28
+ }, children: "New Session" })),
29
+ },
30
+ };
31
+ /** Compact inline variant with reduced padding and horizontal layout. */
32
+ export const Compact = {
33
+ args: {
34
+ compact: true,
35
+ description: 'No matching results',
36
+ },
37
+ };
38
+ /** Empty state with a custom icon instead of the default antd Empty. */
39
+ export const CustomIcon = {
40
+ args: {
41
+ title: 'Not Found',
42
+ icon: _jsx("span", { style: { fontSize: '48px' }, children: '🔍' }),
43
+ },
44
+ };
45
+ //# sourceMappingURL=EmptyState.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.stories.js","sourceRoot":"","sources":["../../src/components/EmptyState.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,sDAAsD;AACtD,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,gCAAgC;KAC9C;CACF,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,+BAA+B;QAC5C,MAAM,EAAE,CACN,iBACE,KAAK,EAAE;gBACL,OAAO,EAAE,UAAU;gBACnB,YAAY,EAAE,KAAK;gBACnB,UAAU,EAAE,SAAS;gBACrB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,SAAS;aAClB,4BAGM,CACV;KACF;CACF,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,qBAAqB;KACnC;CACF,CAAC;AAEF,wEAAwE;AACxE,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAG,IAAI,GAAQ;KACvD;CACF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type ReactNode } from 'react';
2
+ /** Context provided to renderSummary callback. */
3
+ export interface ExpandableItemContext {
4
+ /** Current expanded state. */
5
+ expanded: boolean;
6
+ /** Toggle expanded state. */
7
+ toggle: () => void;
8
+ }
9
+ export interface ExpandableItemProps {
10
+ /** Controlled expand state. */
11
+ expanded?: boolean;
12
+ /** Uncontrolled initial state (default: false). */
13
+ defaultExpanded?: boolean;
14
+ /** Expand state change callback. */
15
+ onToggle?: (expanded: boolean) => void;
16
+ /** Whether this item can expand. */
17
+ expandable?: boolean;
18
+ /** Summary row — always visible. */
19
+ renderSummary: (ctx: ExpandableItemContext) => ReactNode;
20
+ /** Detail content — shown when expanded. */
21
+ renderDetail?: () => ReactNode;
22
+ /** Animation duration in ms (default: 150). */
23
+ animationDuration?: number;
24
+ /** Additional className. */
25
+ className?: string;
26
+ }
27
+ /** Headless expandable list item — behavior only, no UI. */
28
+ export declare const ExpandableItem: import("react").NamedExoticComponent<ExpandableItemProps>;
29
+ //# sourceMappingURL=ExpandableItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandableItem.d.ts","sourceRoot":"","sources":["../../src/components/ExpandableItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1D,kDAAkD;AAClD,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oCAAoC;IACpC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,aAAa,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,SAAS,CAAC;IACzD,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,SAAS,CAAC;IAC/B,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4DAA4D;AAC5D,eAAO,MAAM,cAAc,2DA2CzB,CAAC"}
@@ -0,0 +1,28 @@
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, useCallback } from 'react';
5
+ import { useToggle } from '../hooks/index.js';
6
+ /** Headless expandable list item — behavior only, no UI. */
7
+ export const ExpandableItem = memo(function ExpandableItem({ expanded: controlledExpanded, defaultExpanded = false, onToggle, expandable = true, renderSummary, renderDetail, animationDuration = 150, className, }) {
8
+ const theme = useTheme();
9
+ const toggle = useToggle(defaultExpanded);
10
+ const isExpanded = controlledExpanded !== undefined ? controlledExpanded : toggle.value;
11
+ const canExpand = expandable && !!renderDetail;
12
+ const handleToggle = useCallback(() => {
13
+ if (!canExpand)
14
+ return;
15
+ const next = !isExpanded;
16
+ toggle.set(next);
17
+ onToggle?.(next);
18
+ }, [canExpand, isExpanded, onToggle, toggle]);
19
+ const ctx = {
20
+ expanded: canExpand && isExpanded,
21
+ toggle: handleToggle,
22
+ };
23
+ return (_jsxs("div", { className: className, children: [renderSummary(ctx), canExpand && isExpanded && (_jsx("div", { css: css `
24
+ overflow: hidden;
25
+ transition: max-height ${animationDuration}ms ${theme.motion.easing.out};
26
+ `, children: renderDetail() }))] }));
27
+ });
28
+ //# sourceMappingURL=ExpandableItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandableItem.js","sourceRoot":"","sources":["../../src/components/ExpandableItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAkB,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;A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emotion/react */
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
+ import { ExpandableItem } from './ExpandableItem.js';
4
+ import type { ExpandableItemProps } from './ExpandableItem.js';
5
+ declare const meta: Meta<typeof ExpandableItem>;
6
+ export default meta;
7
+ type Story = StoryObj<ExpandableItemProps>;
8
+ /** A list of expandable event log rows with colored type tags and JSON details. */
9
+ export declare const EventLogItems: Story;
10
+ /** Test case rows — passed items not expandable, failed ones show error details. */
11
+ export declare const TestCaseItems: Story;
12
+ /** Single expandable item with controlled state via React.useState. */
13
+ export declare const SingleItem: Story;
14
+ //# sourceMappingURL=ExpandableItem.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandableItem.stories.d.ts","sourceRoot":"","sources":["../../src/components/ExpandableItem.stories.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAyB,MAAM,qBAAqB,CAAC;AAEtF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAQrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAyH3C,mFAAmF;AACnF,eAAO,MAAM,aAAa,EAAE,KA2D3B,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,aAAa,EAAE,KA8E3B,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,UAAU,EAAE,KA0ExB,CAAC"}