@spaced-out/ui-design-system 0.5.17 → 0.5.19

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 (31) hide show
  1. package/.cspell/custom-words.txt +2 -0
  2. package/.github/workflows/publish-mcp.yml +81 -0
  3. package/CHANGELOG.md +16 -0
  4. package/COMPONENT_PROMPT_TEMPLATE.md +223 -0
  5. package/lib/components/Checklist/Checklist.d.ts +44 -0
  6. package/lib/components/Checklist/Checklist.d.ts.map +1 -0
  7. package/lib/components/Checklist/Checklist.js +146 -0
  8. package/lib/components/Checklist/Checklist.module.css +164 -0
  9. package/lib/components/Checklist/index.d.ts +2 -0
  10. package/lib/components/Checklist/index.d.ts.map +1 -0
  11. package/lib/components/Checklist/index.js +16 -0
  12. package/lib/components/PromptChip/PromptChip.d.ts +1 -0
  13. package/lib/components/PromptChip/PromptChip.d.ts.map +1 -1
  14. package/lib/components/PromptChip/PromptChip.js +14 -12
  15. package/lib/components/PromptChip/PromptChip.module.css +69 -37
  16. package/lib/components/TemplateCard/TemplateCard.d.ts +29 -0
  17. package/lib/components/TemplateCard/TemplateCard.d.ts.map +1 -0
  18. package/lib/components/TemplateCard/TemplateCard.js +92 -0
  19. package/lib/components/TemplateCard/TemplateCard.module.css +170 -0
  20. package/lib/components/TemplateCard/index.d.ts +2 -0
  21. package/lib/components/TemplateCard/index.d.ts.map +1 -0
  22. package/lib/components/TemplateCard/index.js +16 -0
  23. package/lib/components/index.d.ts +2 -0
  24. package/lib/components/index.d.ts.map +1 -1
  25. package/lib/components/index.js +22 -0
  26. package/mcp/README.md +306 -0
  27. package/mcp/build-mcp-data.js +247 -0
  28. package/mcp/index.js +1239 -0
  29. package/mcp/package.json +44 -0
  30. package/mcp/test-server.js +65 -0
  31. package/package.json +1 -1
@@ -83,6 +83,7 @@ Mahe
83
83
  Manaus
84
84
  Minh
85
85
  Moresby
86
+ modelcontextprotocol
86
87
  msword
87
88
  multiarbitrary
88
89
  Neue
@@ -150,6 +151,7 @@ Verda
150
151
  viewports
151
152
  vish
152
153
  VishalBarnawal
154
+ Vishwanath
153
155
  Vivek
154
156
  voiceflow
155
157
  WCAG
@@ -0,0 +1,81 @@
1
+ # Author: Vishwanath
2
+ # Publishes the Genesis MCP Server to NPM when design system changes
3
+
4
+ name: Publish MCP Server to NPM
5
+
6
+ on:
7
+ # Run after the main NPM publish workflow completes successfully
8
+ workflow_run:
9
+ workflows: ['Release Genesis to NPM']
10
+ types:
11
+ - completed
12
+ branches: [master]
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ publish-mcp:
17
+ runs-on: ubuntu-latest
18
+ # Only run if triggered manually or if the workflow_run succeeded
19
+ if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
20
+ steps:
21
+ - name: Check Permissions
22
+ id: check-permissions
23
+ env:
24
+ ALLOWED_USERS: superrover, Anant-Raj, diwakersurya, ashwini-sensehq, vish-sah, VishalBarnawal, sanskar-s, VivekJangid, sharad-kushwah, Swatantramishra1, bhatiarush27, darsh-mecwan-sense, keshavsensehq, SahilShrivastava1, aditya-kaushal, LakshayKumar-1
25
+ if: ${{ !contains(env.ALLOWED_USERS, github.actor) }}
26
+ run: |
27
+ echo "You don't have correct permissions to publish the MCP server"
28
+ exit 1
29
+
30
+ - name: Checkout
31
+ uses: actions/checkout@v4
32
+ with:
33
+ token: ${{ secrets.NPM_PUBLISH_USER_ACCESS_TOKEN }}
34
+ fetch-depth: 0
35
+
36
+ - name: Setup Node.js
37
+ uses: actions/setup-node@v4
38
+ with:
39
+ registry-url: https://registry.npmjs.org/
40
+ node-version: '22.18.0'
41
+
42
+ - name: Git configuration
43
+ run: |
44
+ git config --global user.email "86281150+superrover@users.noreply.github.com"
45
+ git config --global user.name "Nishant Gaurav"
46
+
47
+ - name: Install main dependencies
48
+ run: yarn install
49
+
50
+ - name: Install MCP dependencies
51
+ working-directory: ./mcp
52
+ run: yarn install
53
+
54
+ - name: Auto-bump patch version
55
+ if: github.event_name == 'workflow_run'
56
+ working-directory: ./mcp
57
+ run: |
58
+ echo "📦 Auto-bumping patch version after design system publish"
59
+ yarn version --patch --no-git-tag-version
60
+ NEW_VERSION=$(node -p "require('./package.json').version")
61
+ echo "New version: $NEW_VERSION"
62
+ echo "MCP_VERSION=$NEW_VERSION" >> $GITHUB_ENV
63
+
64
+ - name: Build MCP data
65
+ working-directory: ./mcp
66
+ run: yarn build
67
+
68
+ - name: Commit version bump
69
+ if: github.event_name == 'workflow_run'
70
+ env:
71
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72
+ run: |
73
+ git add mcp/package.json mcp/yarn.lock
74
+ git commit -m "chore(release-mcp): ${{ env.MCP_VERSION }} [skip ci]"
75
+ git push origin master
76
+
77
+ - name: Publish to NPM
78
+ working-directory: ./mcp
79
+ env:
80
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
81
+ run: yarn publish --verbose --access public
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.5.19](https://github.com/spaced-out/ui-design-system/compare/v0.5.18...v0.5.19) (2025-11-11)
6
+
7
+
8
+ ### Features
9
+
10
+ * add Genesis MCP server with automated publishing ([#421](https://github.com/spaced-out/ui-design-system/issues/421)) ([f8ae05c](https://github.com/spaced-out/ui-design-system/commit/f8ae05c3e0344eccbaad33c394bd68711afa8579))
11
+ * template card ([#426](https://github.com/spaced-out/ui-design-system/issues/426)) ([ba803e3](https://github.com/spaced-out/ui-design-system/commit/ba803e3adf17096cbae849a7961b44848bd8443a))
12
+ * wrap prop added in prompt chip ([#423](https://github.com/spaced-out/ui-design-system/issues/423)) ([25f60c4](https://github.com/spaced-out/ui-design-system/commit/25f60c4e82b9a177033dedca108dae3faed1a16c))
13
+
14
+ ### [0.5.18](https://github.com/spaced-out/ui-design-system/compare/v0.5.17...v0.5.18) (2025-11-11)
15
+
16
+
17
+ ### Features
18
+
19
+ * **GDS-545:** Checklist AI component ([#425](https://github.com/spaced-out/ui-design-system/issues/425)) ([b2da14e](https://github.com/spaced-out/ui-design-system/commit/b2da14e9a70067943f874d4e504d0186ef905015))
20
+
5
21
  ### [0.5.17](https://github.com/spaced-out/ui-design-system/compare/v0.5.16...v0.5.17) (2025-11-10)
6
22
 
7
23
 
@@ -0,0 +1,223 @@
1
+ # Genesis Design System - Component Implementation Prompt Template
2
+
3
+ Use this template when creating new components to ensure proper integration with the Genesis Design System MCP server.
4
+
5
+ ---
6
+
7
+ ## Component Implementation Request
8
+
9
+ ### Component Name
10
+
11
+ **[ComponentName]** (e.g., "TemplateCard", "StatusBadge", "AlertDialog")
12
+
13
+ ### Design Reference
14
+
15
+ Implement this design from Figma:
16
+ @[Figma URL with node-id]
17
+
18
+ **Additional References (if applicable):**
19
+
20
+ - Component states: @[Figma URL]
21
+ - Component anatomy: @[Figma URL]
22
+ - Interactions: @[Figma URL]
23
+
24
+ ---
25
+
26
+ ## Genesis Design System Integration
27
+
28
+ ### 1. Check Similar Components First
29
+
30
+ Before starting, review existing Genesis components for patterns:
31
+
32
+ - [List similar components to check, e.g., "Card", "Icon", "Button"]
33
+
34
+ **Ask:** "What similar components exist in Genesis?"
35
+
36
+ ### 2. Identify Reusable Components & Types
37
+
38
+ This component will use:
39
+
40
+ - [ ] Icon component → Query for `IconType`, `IconSize` exports
41
+ - [ ] Button component → Query for `ButtonProps`, button variants
42
+ - [ ] [Other components] → Check their exported types
43
+
44
+ **Ask:** "What types does [Component] export?"
45
+
46
+ ### 3. Implementation Checklist
47
+
48
+ Before implementing:
49
+
50
+ - [ ] Call `get_css_module_guidelines` for CSS best practices
51
+ - [ ] Call `get_component` for each component you'll use (to get exported types)
52
+ - [ ] Call `get_design_tokens` for relevant categories (color, space, size, etc.)
53
+ - [ ] Review similar component's CSS for state/modifier patterns
54
+
55
+ ---
56
+
57
+ ## Component Specifications
58
+
59
+ ### TypeScript Requirements ⚠️
60
+
61
+ **IMPORTANT**: Use **pure TypeScript** only. Do NOT use Flow types.
62
+
63
+ - ❌ **NO** `Flow.AbstractComponent`
64
+ - ❌ **NO** `import type {Flow} from 'flow-to-typescript-codemod'`
65
+ - ✅ **YES** `React.forwardRef<HTMLDivElement, Props>`
66
+
67
+ **Correct TypeScript Pattern:**
68
+
69
+ ```typescript
70
+ export const ComponentName = React.forwardRef<
71
+ HTMLDivElement,
72
+ ComponentNameProps
73
+ >(({prop1, prop2, ...props}, ref) => (
74
+ <div ref={ref} {...props}>
75
+ {/* component content */}
76
+ </div>
77
+ ));
78
+ ```
79
+
80
+ ### Props Interface
81
+
82
+ Define the component props clearly:
83
+
84
+ ```typescript
85
+ export interface [ComponentName]Props {
86
+ // List each prop with:
87
+ // - name: type - description
88
+ // - Indicate if using imported types from other components
89
+
90
+ classNames?: ClassNames; // Standard Genesis pattern
91
+ testId?: string; // Standard Genesis pattern
92
+ }
93
+ ```
94
+
95
+ **Example:**
96
+
97
+ ```typescript
98
+ export interface TemplateCardProps {
99
+ headerColor?: HeaderColorType; // Custom type for this component
100
+ iconName: string; // Use string, render Icon internally
101
+ iconType?: IconType; // ✅ Import from Icon component
102
+ footer?: React.ReactNode; // Flexible content
103
+ children?: React.ReactNode; // Flexible content
104
+ }
105
+ ```
106
+
107
+ ### Component Structure
108
+
109
+ Describe the component's structure:
110
+
111
+ 1. **[Section Name]**: Description
112
+
113
+ - Details about this section
114
+ - Behavior notes
115
+
116
+ 2. **[Another Section]**: Description
117
+ - Details
118
+
119
+ ### Behavior & Interactions
120
+
121
+ - [Describe interactive behavior]
122
+ - [Describe state management]
123
+ - [Describe accessibility requirements]
124
+
125
+ ### Content Philosophy
126
+
127
+ Specify which parts are:
128
+
129
+ - **Fixed structure** (controlled by component)
130
+ - **Flexible content** (user provides via props)
131
+
132
+ **Important:** Keep all content demonstrations in Storybook stories only, not in the component implementation.
133
+
134
+ ---
135
+
136
+ ## States/Variants
137
+
138
+ List all component states or variants:
139
+
140
+ - State 1: Description
141
+ - State 2: Description
142
+ - Default state
143
+
144
+ ---
145
+
146
+ ## Special Instructions
147
+
148
+ Any component-specific requirements or constraints:
149
+
150
+ - [Special requirement 1]
151
+ - [Special requirement 2]
152
+
153
+ ---
154
+
155
+ ## Example Implementation
156
+
157
+ Provide any code examples or patterns to follow:
158
+
159
+ ```typescript
160
+ // Example pattern to follow
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Notes
166
+
167
+ - **Use TypeScript only** (NO Flow types like `Flow.AbstractComponent`)
168
+ - Follow all Genesis Design System patterns (accessible via MCP)
169
+ - Use design tokens for all values (no hardcoded pixels/colors)
170
+ - Reuse exported types from existing components
171
+ - Test all states in Storybook
172
+
173
+ ---
174
+
175
+ ## Why This Template Works
176
+
177
+ ### MCP Server Integration
178
+
179
+ This template is designed to work with the Genesis MCP server which provides:
180
+
181
+ - **`get_css_module_guidelines`** - CSS best practices and patterns
182
+ - **`get_component`** - Component details including exported types
183
+ - **`get_design_tokens`** - Available design tokens by category
184
+ - **`get_component_template`** - Template files for new components
185
+
186
+ ### Key Benefits
187
+
188
+ 1. **Pure TypeScript**: All new components use modern TypeScript patterns (no Flow)
189
+ 2. **Type Reuse**: Automatically discover and import existing types
190
+ 3. **Pattern Consistency**: Follow established CSS and component patterns
191
+ 4. **Token Usage**: Use design tokens instead of hardcoded values
192
+ 5. **Guided Implementation**: Checklist ensures nothing is missed
193
+
194
+ ### Magic Phrases
195
+
196
+ Include these in your prompts to trigger MCP usage:
197
+
198
+ - ✅ "Query [Component] for exported types"
199
+ - ✅ "Call get_css_module_guidelines before creating CSS"
200
+ - ✅ "Compare with [SimilarComponent].module.css for patterns"
201
+ - ✅ "Use design tokens (check get_design_tokens)"
202
+ - ✅ "Import [Type] from [Component] (don't redefine)"
203
+
204
+ ---
205
+
206
+ ## Quick Start
207
+
208
+ For any new component:
209
+
210
+ 1. **Discovery Phase:**
211
+
212
+ ```
213
+ "What similar components exist in Genesis?"
214
+ "What types does Icon/Button/[Component] export?"
215
+ "Show me CSS Module guidelines"
216
+ "What design tokens are available for colors/spacing/sizes?"
217
+ ```
218
+
219
+ 2. **Fill out this template** with your specific requirements
220
+
221
+ 3. **Provide to AI** with all Figma links and specifications
222
+
223
+ 4. **Review implementation** against Genesis patterns
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import type { ColorTypes } from '../../types/typography';
3
+ import type { IconType } from '../../components/Icon';
4
+ type ClassNames = Readonly<{
5
+ header?: string;
6
+ wrapper?: string;
7
+ content?: string;
8
+ listItemContainer?: string;
9
+ cardContentContainer?: string;
10
+ }>;
11
+ export interface ChecklistItem {
12
+ label: React.ReactNode;
13
+ key: string;
14
+ iconLeftName?: string;
15
+ iconLeftType?: IconType;
16
+ iconLeftColor?: ColorTypes;
17
+ disabled?: boolean;
18
+ rightSlot?: React.ReactNode;
19
+ onExpand?: (item: ChecklistItem) => void;
20
+ }
21
+ export interface ChecklistProps {
22
+ classNames?: ClassNames;
23
+ isOpen?: boolean;
24
+ testId?: string;
25
+ title: React.ReactNode;
26
+ rightSlot?: React.ReactNode;
27
+ footer?: React.ReactNode;
28
+ listItems: Array<ChecklistItem>;
29
+ hideChecklistItemExpandButton?: boolean;
30
+ }
31
+ export interface ChecklistProgressBarProps {
32
+ classNames?: {
33
+ wrapper?: string;
34
+ container?: string;
35
+ bar?: string;
36
+ };
37
+ totalItems: number;
38
+ completedItems: number;
39
+ showLoadingBar?: boolean;
40
+ }
41
+ export declare const ChecklistProgressBar: React.ForwardRefExoticComponent<ChecklistProgressBarProps & React.RefAttributes<HTMLDivElement>>;
42
+ export declare const Checklist: React.ForwardRefExoticComponent<ChecklistProps & React.RefAttributes<HTMLDivElement>>;
43
+ export {};
44
+ //# sourceMappingURL=Checklist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checklist.d.ts","sourceRoot":"","sources":["../../../src/components/Checklist/Checklist.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAMrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AASlD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAChC,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,oBAAoB,kGAiB/B,CAAC;AAEH,eAAO,MAAM,SAAS,uFAwHrB,CAAC"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChecklistProgressBar = exports.Checklist = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _classify = _interopRequireDefault(require("../../utils/classify"));
9
+ var _qa = require("../../utils/qa");
10
+ var _Button = require("../Button");
11
+ var _Card = require("../Card");
12
+ var _Icon = require("../Icon");
13
+ var _Text = require("../Text");
14
+ var _Truncate = require("../Truncate");
15
+ var _TruncatedTextWithTooltip = require("../TruncatedTextWithTooltip");
16
+ var _ChecklistModule = _interopRequireDefault(require("./Checklist.module.css"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
+ const ChecklistProgressBar = exports.ChecklistProgressBar = /*#__PURE__*/React.forwardRef(_ref => {
21
+ let {
22
+ totalItems,
23
+ completedItems,
24
+ showLoadingBar,
25
+ classNames
26
+ } = _ref;
27
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
28
+ className: (0, _classify.default)(_ChecklistModule.default.checklistProgressBar, classNames?.wrapper),
29
+ children: [showLoadingBar ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
30
+ className: (0, _classify.default)(_ChecklistModule.default.progressLinear, classNames?.container),
31
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
32
+ className: (0, _classify.default)(_ChecklistModule.default.progressLinearBar, classNames?.bar),
33
+ style: {
34
+ width: `${Math.min(completedItems / totalItems * 100, 100)}%`
35
+ }
36
+ })
37
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodyMediumBold, {
38
+ children: `${completedItems} / ${totalItems}`
39
+ })]
40
+ });
41
+ });
42
+ const Checklist = exports.Checklist = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
43
+ let {
44
+ isOpen,
45
+ classNames,
46
+ testId,
47
+ title,
48
+ rightSlot,
49
+ footer,
50
+ listItems = [],
51
+ hideChecklistItemExpandButton = false
52
+ } = _ref2;
53
+ const [collapsibleCardIsOpen, setCollapsibleCardIsOpen] = React.useState(Boolean(isOpen));
54
+ React.useEffect(() => {
55
+ setCollapsibleCardIsOpen(Boolean(isOpen));
56
+ }, [isOpen]);
57
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
58
+ ref: ref,
59
+ "data-testid": (0, _qa.generateTestId)({
60
+ base: testId,
61
+ slot: 'wrapper'
62
+ }),
63
+ className: (0, _classify.default)(_ChecklistModule.default.wrapper, classNames?.wrapper),
64
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.UnstyledButton, {
65
+ className: (0, _classify.default)(_ChecklistModule.default.header, {
66
+ [_ChecklistModule.default.isOpen]: collapsibleCardIsOpen
67
+ }, classNames?.header),
68
+ onClick: () => {
69
+ setCollapsibleCardIsOpen(!collapsibleCardIsOpen);
70
+ },
71
+ testId: (0, _qa.generateTestId)({
72
+ base: testId,
73
+ slot: 'header-button'
74
+ }),
75
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
76
+ className: _ChecklistModule.default.headerContent,
77
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
78
+ className: _ChecklistModule.default.titleContainer,
79
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
80
+ name: collapsibleCardIsOpen ? 'chevron-up' : 'chevron-down',
81
+ color: "secondary",
82
+ size: "small",
83
+ testId: (0, _qa.generateTestId)({
84
+ base: testId,
85
+ slot: collapsibleCardIsOpen ? 'chevron-up' : 'chevron-down'
86
+ })
87
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
88
+ testId: (0, _qa.generateTestId)({
89
+ base: testId,
90
+ slot: 'title'
91
+ }),
92
+ children: title
93
+ })]
94
+ }), rightSlot ? rightSlot : null]
95
+ })
96
+ }), collapsibleCardIsOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
97
+ className: (0, _classify.default)(_ChecklistModule.default.content, classNames?.content),
98
+ "data-testid": (0, _qa.generateTestId)({
99
+ base: testId,
100
+ slot: 'content'
101
+ }),
102
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.Card, {
103
+ classNames: {
104
+ wrapper: _ChecklistModule.default.cardWrapper
105
+ },
106
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardContent, {
107
+ className: (0, _classify.default)(_ChecklistModule.default.cardContentContainer, classNames?.cardContentContainer),
108
+ children: listItems.map(item => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.UnstyledButton, {
109
+ className: (0, _classify.default)(_ChecklistModule.default.checklistItemContainer, classNames?.listItemContainer),
110
+ onClick: () => item.onExpand?.(item),
111
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
112
+ className: _ChecklistModule.default.checklistItemLeft,
113
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
114
+ name: item.iconLeftName || '',
115
+ type: item.iconLeftType,
116
+ color: item.iconLeftColor || 'tertiary'
117
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodyMedium, {
118
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TruncatedTextWithTooltip.TruncatedTextWithTooltip, {
119
+ tooltip: {
120
+ bodyMaxLines: 2,
121
+ elevation: 'modal'
122
+ },
123
+ children: item.label
124
+ })
125
+ })]
126
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
127
+ className: _ChecklistModule.default.checklistItemRight,
128
+ children: item.rightSlot ? item.rightSlot : !hideChecklistItemExpandButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
129
+ name: "chevron-right",
130
+ color: "secondary",
131
+ size: "small",
132
+ testId: (0, _qa.generateTestId)({
133
+ base: testId,
134
+ slot: 'chevron-right'
135
+ })
136
+ }) : null
137
+ })]
138
+ }))
139
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardFooter, {
140
+ children: footer
141
+ })]
142
+ })
143
+ })]
144
+ });
145
+ });
146
+ Checklist.displayName = 'Checklist';
@@ -0,0 +1,164 @@
1
+ @value (
2
+ colorBorderPrimary,
3
+ colorBackgroundPrimary,
4
+ colorBackgroundTertiary,
5
+ colorBackgroundSecondary,
6
+ colorFillPrimary
7
+ ) from '../../styles/variables/_color.css';
8
+ @value (
9
+ sizeFluid,
10
+ size58,
11
+ size34,
12
+ size42,
13
+ size8,
14
+ size400,
15
+ size20,
16
+ size100,
17
+ size200
18
+ ) from '../../styles/variables/_size.css';
19
+ @value (
20
+ spaceSmall,
21
+ spaceXSmall
22
+ ) from '../../styles/variables/_space.css';
23
+ @value (
24
+ elevationCard,
25
+ elevationMenu
26
+ ) from '../../styles/variables/_elevation.css';
27
+ @value (
28
+ borderWidthPrimary,
29
+ borderRadiusSmall,
30
+ borderRadiusNone
31
+ ) from '../../styles/variables/_border.css';
32
+
33
+ .wrapper {
34
+ display: flex;
35
+ flex-flow: column;
36
+ width: sizeFluid;
37
+ position: relative;
38
+ }
39
+
40
+ .header {
41
+ composes: subTitleSmall from '../../styles/typography.module.css';
42
+ composes: borderPrimary from '../../styles/border.module.css';
43
+ min-height: size42;
44
+ border-radius: borderRadiusSmall;
45
+ display: flex;
46
+ cursor: pointer;
47
+ align-items: flex-start;
48
+ width: sizeFluid;
49
+ justify-content: space-between;
50
+ gap: spaceSmall;
51
+ padding: spaceSmall;
52
+ background-color: colorBackgroundTertiary;
53
+ z-index: elevationCard;
54
+ }
55
+
56
+ .header.isOpen {
57
+ min-height: size58;
58
+ background-color: colorBackgroundPrimary;
59
+ }
60
+
61
+ .headerContent {
62
+ display: flex;
63
+ gap: spaceXSmall;
64
+ align-items: center;
65
+ justify-content: space-between;
66
+ width: sizeFluid;
67
+ }
68
+
69
+ .content {
70
+ display: flex;
71
+ flex-flow: column;
72
+ background-color: colorBackgroundPrimary;
73
+ position: absolute;
74
+ top: calc(sizeFluid - size20);
75
+ border-radius: borderRadiusSmall;
76
+ width: sizeFluid;
77
+ }
78
+
79
+ .cardWrapper {
80
+ z-index: elevationMenu;
81
+ }
82
+
83
+ .contentContainer {
84
+ display: flex;
85
+ padding: spaceSmall;
86
+ }
87
+
88
+ .actionContainer {
89
+ display: flex;
90
+ border-top: borderWidthPrimary solid colorBorderPrimary;
91
+ border-radius: borderRadiusNone borderRadiusNone borderRadiusSmall
92
+ borderRadiusSmall;
93
+ background-color: colorBackgroundTertiary;
94
+ padding: spaceSmall;
95
+ gap: spaceXSmall;
96
+ }
97
+
98
+ .titleContainer {
99
+ display: flex;
100
+ gap: spaceXSmall;
101
+ align-items: center;
102
+ }
103
+
104
+ .cardContentContainer {
105
+ display: flex;
106
+ flex-flow: column;
107
+ gap: spaceXSmall;
108
+ padding: spaceSmall;
109
+ width: sizeFluid;
110
+ justify-content: space-between;
111
+ max-height: size400;
112
+ overflow-y: auto;
113
+ }
114
+
115
+ .checklistItemContainer {
116
+ display: flex;
117
+ gap: spaceXSmall;
118
+ align-items: center;
119
+ width: sizeFluid;
120
+ background-color: colorBackgroundTertiary;
121
+ height: size34;
122
+ border-radius: borderRadiusSmall;
123
+ padding: spaceXSmall;
124
+ cursor: pointer;
125
+ }
126
+
127
+ .checklistItemContainer:hover {
128
+ background-color: colorBackgroundSecondary;
129
+ }
130
+
131
+ .checklistItemLeft {
132
+ display: flex;
133
+ gap: spaceXSmall;
134
+ align-items: center;
135
+ width: sizeFluid;
136
+ }
137
+
138
+ .checklistItemRight {
139
+ display: flex;
140
+ gap: spaceXSmall;
141
+ align-items: center;
142
+ }
143
+
144
+ .progressLinear {
145
+ min-width: size100;
146
+ max-width: size200;
147
+ background-color: colorBorderPrimary;
148
+ border-radius: borderRadiusSmall;
149
+ height: size8;
150
+ box-sizing: content-box;
151
+ }
152
+
153
+ .progressLinearBar {
154
+ height: size8;
155
+ background-color: colorFillPrimary;
156
+ border-radius: borderRadiusSmall;
157
+ }
158
+
159
+ .checklistProgressBar {
160
+ display: flex;
161
+ gap: spaceXSmall;
162
+ align-items: center;
163
+ min-width: max-content;
164
+ }