@kiva/kv-components 8.0.0 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +11 -0
- package/AGENTS.md +184 -0
- package/CLAUDE.md +11 -0
- package/GEMINI.md +11 -0
- package/dist/vue/KvLendCta.css +1 -1
- package/dist/vue/KvLendCta.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@AGENTS.md
|
|
2
|
+
|
|
3
|
+
# GitHub Copilot Instructions
|
|
4
|
+
|
|
5
|
+
> **Important**: Always include context from [AGENTS.md](../AGENTS.md) as the primary directive for this package.
|
|
6
|
+
|
|
7
|
+
> **Note**: This file should only contain GitHub Copilot-specific configurations or workarounds as a last resort. All general development instructions, patterns, and guidelines belong in [AGENTS.md](../AGENTS.md).
|
|
8
|
+
|
|
9
|
+
## GitHub Copilot-Specific Configuration
|
|
10
|
+
|
|
11
|
+
(Reserved for GitHub Copilot-specific settings only)
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# @kiva/kv-components - Vue 3 Component Library
|
|
2
|
+
|
|
3
|
+
Accessible UI component library built with Vue 3 Composition API, Tailwind CSS, and Storybook.
|
|
4
|
+
|
|
5
|
+
## Technology Stack
|
|
6
|
+
|
|
7
|
+
- **Vue 3** - Composition API (using `setup()` function, NOT `<script setup>`)
|
|
8
|
+
- **TypeScript** - All components and utilities use TypeScript with type definitions
|
|
9
|
+
- **Tailwind CSS** - Custom `tw-` prefix for all utility classes
|
|
10
|
+
- **Vite** - Build tool configured for library mode
|
|
11
|
+
- **Jest + Vue Testing Library** - Testing framework
|
|
12
|
+
- **Storybook 10** - Component documentation and development
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
**Always run `nvm use` when working in this repo** to ensure you're using the correct Node.js version specified in [.nvmrc](../../../.nvmrc).
|
|
17
|
+
|
|
18
|
+
## Component Development Patterns
|
|
19
|
+
|
|
20
|
+
### Component Structure
|
|
21
|
+
|
|
22
|
+
Components use Vue 3 Composition API with two supported patterns:
|
|
23
|
+
|
|
24
|
+
- **`<script setup>` syntax** (recommended for new components) - Modern, concise syntax for Vue 3 Composition API
|
|
25
|
+
- **`export default { setup() }` pattern** (used in existing components) - Allows named exports of types, interfaces, or utility functions alongside the component
|
|
26
|
+
- Components located in [src/vue/](src/vue/)
|
|
27
|
+
- **ALL new components must be exported** in [src/vue/index.ts](src/vue/index.ts)
|
|
28
|
+
- Reference examples: [KvButton.vue](src/vue/KvButton.vue), [KvCarousel.vue](src/vue/KvCarousel.vue), [KvExpandable.vue](src/vue/KvExpandable.vue)
|
|
29
|
+
|
|
30
|
+
### Key Patterns
|
|
31
|
+
|
|
32
|
+
1. **Props** - Define with TypeScript type annotations and JSDoc for Storybook documentation
|
|
33
|
+
2. **Composition API** - Use `ref`, `computed`, `toRefs`, `onMounted` from Vue
|
|
34
|
+
3. **Utilities** - See [attrs.ts](src/utils/attrs.ts) for splitting attrs/listeners
|
|
35
|
+
4. **Slots** - Provide flexible content projection
|
|
36
|
+
5. **v-model** - Use `modelValue` prop and `update:modelValue` emit for Vue 3
|
|
37
|
+
6. **Accessibility** - ARIA labels, semantic HTML, keyboard navigation required
|
|
38
|
+
|
|
39
|
+
## Styling Guidelines
|
|
40
|
+
|
|
41
|
+
### Tailwind CSS
|
|
42
|
+
|
|
43
|
+
- **Prefix**: ALL Tailwind classes use `tw-` prefix (e.g., `tw-bg-primary`, `tw-text-h1`)
|
|
44
|
+
- **Design tokens**: Import from [@kiva/kv-tokens](../kv-tokens/) package
|
|
45
|
+
- **Theme system**: Use [KvThemeProvider.vue](src/vue/KvThemeProvider.vue) for light/dark mode
|
|
46
|
+
- **Config**: See [tailwind.config.js](tailwind.config.js)
|
|
47
|
+
|
|
48
|
+
### Icons
|
|
49
|
+
|
|
50
|
+
- Use Material Design Icons from `@mdi/js`
|
|
51
|
+
- Import paths like `import { mdiChevronRight } from '@mdi/js'`
|
|
52
|
+
- Render with [KvMaterialIcon.vue](src/vue/KvMaterialIcon.vue) component
|
|
53
|
+
|
|
54
|
+
## Code Quality Standards
|
|
55
|
+
|
|
56
|
+
### ESLint Configuration
|
|
57
|
+
|
|
58
|
+
See [.eslintrc.cjs](.eslintrc.cjs) for full rules:
|
|
59
|
+
|
|
60
|
+
- **Indentation**: Tabs (NOT spaces)
|
|
61
|
+
- **Max line length**: 120 characters
|
|
62
|
+
- **Vue rules**: Vue 3 recommended + no self-closing HTML elements
|
|
63
|
+
- **TypeScript**: Uses `@typescript-eslint/parser` and `@vue/eslint-config-typescript`
|
|
64
|
+
- **Path aliases**: Use `#components`, `#utils`, `#fixtures` imports
|
|
65
|
+
- **File extensions**: Import resolver configured for `.ts`, `.js`, `.json`, `.vue`
|
|
66
|
+
|
|
67
|
+
### File Naming Conventions
|
|
68
|
+
|
|
69
|
+
- Components: `KvComponentName.vue` (PascalCase in [src/vue/](src/vue/) with `<script lang="ts">`)
|
|
70
|
+
- Utilities: `utilityName.ts` (camelCase in [src/utils/](src/utils/))
|
|
71
|
+
- Tests: `ComponentName.spec.js` or `ComponentName.spec.ts` (in [tests/unit/specs/components/](tests/unit/specs/components/))
|
|
72
|
+
- Stories: `ComponentName.stories.js` or `ComponentName.stories.ts` (in [src/vue/stories/](src/vue/stories/))
|
|
73
|
+
|
|
74
|
+
## Testing Requirements
|
|
75
|
+
|
|
76
|
+
### Test Framework
|
|
77
|
+
|
|
78
|
+
- **Jest** configured in [jest.config.cjs](jest.config.cjs)
|
|
79
|
+
- **Vue Testing Library** for component testing
|
|
80
|
+
- **jest-axe** for automated accessibility testing (MANDATORY)
|
|
81
|
+
- **Test files**: Supports both `.spec.js` and `.spec.ts` extensions
|
|
82
|
+
|
|
83
|
+
### Test Pattern
|
|
84
|
+
|
|
85
|
+
Reference [tests/unit/specs/components/KvButton.spec.js](tests/unit/specs/components/KvButton.spec.js) for structure:
|
|
86
|
+
|
|
87
|
+
1. Import component, `render`, `fireEvent` from `@testing-library/vue`
|
|
88
|
+
2. Import `axe` from `jest-axe`
|
|
89
|
+
3. Write accessibility test with `toHaveNoViolations()` matcher
|
|
90
|
+
4. Test user interactions with `fireEvent`
|
|
91
|
+
5. Test props, slots, and emitted events
|
|
92
|
+
6. Use [tests/fixtures/](tests/fixtures/) for mock data as needed
|
|
93
|
+
|
|
94
|
+
### Running Tests
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm run test # Runs lint + jest
|
|
98
|
+
npm run lint # ESLint check
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Storybook Development
|
|
102
|
+
|
|
103
|
+
### Configuration
|
|
104
|
+
|
|
105
|
+
- **Version**: 10.1.10
|
|
106
|
+
- **Config**: [src/vue/.storybook/main.js](src/vue/.storybook/main.js)
|
|
107
|
+
- **Addons**: a11y, docs, links
|
|
108
|
+
- **Port**: 6006
|
|
109
|
+
|
|
110
|
+
### Story Format (CSF)
|
|
111
|
+
|
|
112
|
+
Reference [src/vue/stories/KvButton.stories.js](src/vue/stories/KvButton.stories.js) for structure:
|
|
113
|
+
|
|
114
|
+
1. Export default object with `title`, `component`, `argTypes`
|
|
115
|
+
2. Create `Template` function returning component setup
|
|
116
|
+
3. Export story variations binding Template
|
|
117
|
+
4. Configure `args` for each variation
|
|
118
|
+
5. Stories can be written in JavaScript or TypeScript (`.stories.js` or `.stories.ts`)
|
|
119
|
+
|
|
120
|
+
### JSDoc for Storybook
|
|
121
|
+
|
|
122
|
+
Document props, slots, and events with JSDoc in component files for auto-documentation in Storybook Docs.
|
|
123
|
+
|
|
124
|
+
### Running Storybook
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm run storybook # Start dev server on :6006
|
|
128
|
+
npm run build-storybook # Build static Storybook
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Build System
|
|
132
|
+
|
|
133
|
+
### Vite Configuration
|
|
134
|
+
|
|
135
|
+
See [vite.config.ts](vite.config.ts):
|
|
136
|
+
|
|
137
|
+
- **Library mode** with ES modules output
|
|
138
|
+
- **No bundling** - preserves file structure
|
|
139
|
+
- **CSS code splitting** - separate CSS per component
|
|
140
|
+
- Custom plugin [@kiva/vite-plugin-vue-lib-css](../vite-plugin-vue-lib-css/)
|
|
141
|
+
|
|
142
|
+
### Build Scripts
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npm run prebuild # Copy flag assets
|
|
146
|
+
npm run build # Vite library build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Component Creation Workflow
|
|
150
|
+
|
|
151
|
+
1. Create component in [src/vue/](src/vue/) following patterns in [KvButton.vue](src/vue/KvButton.vue)
|
|
152
|
+
2. **Export the component** in [src/vue/index.ts](src/vue/index.ts) - use `export * from` for named exports of types/interfaces
|
|
153
|
+
3. Write Storybook story in [src/vue/stories/](src/vue/stories/) following [KvButton.stories.js](src/vue/stories/KvButton.stories.js)
|
|
154
|
+
4. Write tests in [tests/unit/specs/components/](tests/unit/specs/components/) following [KvButton.spec.js](tests/unit/specs/components/KvButton.spec.js)
|
|
155
|
+
5. Ensure jest-axe accessibility tests pass
|
|
156
|
+
6. Run `npm run test` to validate linting and tests
|
|
157
|
+
7. Review in Storybook with `npm run storybook`
|
|
158
|
+
|
|
159
|
+
## Design System Integration
|
|
160
|
+
|
|
161
|
+
### @kiva/kv-tokens
|
|
162
|
+
|
|
163
|
+
Import design primitives from [@kiva/kv-tokens](../kv-tokens/):
|
|
164
|
+
|
|
165
|
+
- **Colors**: Themable variants (primary, secondary, action, caution, danger)
|
|
166
|
+
- **Typography**: Text styles (h1, h2, body, small)
|
|
167
|
+
- **Spacing**: Consistent spacing scale
|
|
168
|
+
- **Shadows, radii, opacity, z-index**: Component tokens
|
|
169
|
+
|
|
170
|
+
## Accessibility Standards
|
|
171
|
+
|
|
172
|
+
All components MUST:
|
|
173
|
+
|
|
174
|
+
- Pass automated jest-axe testing
|
|
175
|
+
- Include proper ARIA attributes
|
|
176
|
+
- Support keyboard navigation
|
|
177
|
+
- Use semantic HTML elements
|
|
178
|
+
- Meet WCAG color contrast requirements
|
|
179
|
+
|
|
180
|
+
## Additional Resources
|
|
181
|
+
|
|
182
|
+
- [Published Storybook](https://main--608b4cf87f686c00213841b1.chromatic.com/?path=/docs/base-styling-primitives--primitives)
|
|
183
|
+
- [Package README](README.md)
|
|
184
|
+
- [GitHub Repository](https://github.com/kiva/kv-ui-elements)
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@AGENTS.md
|
|
2
|
+
|
|
3
|
+
# Claude AI Instructions
|
|
4
|
+
|
|
5
|
+
> **Important**: Always include context from [AGENTS.md](AGENTS.md) as the primary directive for this package.
|
|
6
|
+
|
|
7
|
+
> **Note**: This file should only contain Claude-specific configurations or workarounds as a last resort. All general development instructions, patterns, and guidelines belong in [AGENTS.md](AGENTS.md).
|
|
8
|
+
|
|
9
|
+
## Claude-Specific Configuration
|
|
10
|
+
|
|
11
|
+
(Reserved for Claude-specific settings only)
|
package/GEMINI.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@AGENTS.md
|
|
2
|
+
|
|
3
|
+
# Gemini AI Instructions
|
|
4
|
+
|
|
5
|
+
> **Important**: Always include context from [AGENTS.md](AGENTS.md) as the primary directive for this package.
|
|
6
|
+
|
|
7
|
+
> **Note**: This file should only contain Gemini-specific configurations or workarounds as a last resort. All general development instructions, patterns, and guidelines belong in [AGENTS.md](AGENTS.md).
|
|
8
|
+
|
|
9
|
+
## Gemini-Specific Configuration
|
|
10
|
+
|
|
11
|
+
(Reserved for Gemini-specific settings only)
|
package/dist/vue/KvLendCta.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.amountDropdownWrapper[data-v-
|
|
1
|
+
.amountDropdownWrapper[data-v-3cabdb94] select{border-radius:14px 0 0 14px!important}.lend-again[data-v-3cabdb94] span{padding-left:.5rem;padding-right:.5rem}.lendButtonWrapper[data-v-3cabdb94] span:first-child{border-radius:0 14px 14px 0}.filtered-dropdown[data-v-3cabdb94] select{cursor:pointer;border-radius:1rem;border-width:2px;font-weight:500}.unselected-dropdown[data-v-3cabdb94] select{--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.preset-option[data-v-3cabdb94] span.tw-w-full:first-child{border-width:2px;--tw-border-opacity: 1;border-color:rgb(158 158 158 / var(--tw-border-opacity, 1))}.selected-dropdown[data-v-3cabdb94] select,.selected-option[data-v-3cabdb94] span.tw-w-full:first-child{--tw-border-opacity: 1;border-color:rgba(var(--border-action),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--bg-secondary),var(--tw-bg-opacity, 1))}.button-ellipsis[data-v-3cabdb94] span>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (max-width: 410px){.mobile-dropdown-small[data-v-3cabdb94]{flex:0 0 40%}}
|
package/dist/vue/KvLendCta.js
CHANGED
|
@@ -349,7 +349,7 @@ function X(B, o, n, Y, d, e) {
|
|
|
349
349
|
], 32)) : i("", !0)
|
|
350
350
|
], 512);
|
|
351
351
|
}
|
|
352
|
-
const le = /* @__PURE__ */ y(P, [["render", X], ["__scopeId", "data-v-
|
|
352
|
+
const le = /* @__PURE__ */ y(P, [["render", X], ["__scopeId", "data-v-3cabdb94"]]);
|
|
353
353
|
export {
|
|
354
354
|
oe as KV_LEND_CTA_FRAGMENT,
|
|
355
355
|
se as KV_LEND_CTA_USER_FRAGMENT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@babel/preset-env": "^7.24.8",
|
|
35
35
|
"@babel/preset-react": "^7.24.7",
|
|
36
36
|
"@babel/preset-typescript": "^7.24.7",
|
|
37
|
-
"@kiva/kv-tokens": "^3.6.
|
|
37
|
+
"@kiva/kv-tokens": "^3.6.3",
|
|
38
38
|
"@kiva/vite-plugin-vue-lib-css": "^2.0.0",
|
|
39
39
|
"@laynezh/vite-plugin-lib-assets": "^0.6.1",
|
|
40
40
|
"@mdi/js": "^7.4.47",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"embla-carousel-fade",
|
|
126
126
|
"popper.js"
|
|
127
127
|
],
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "26291f78d5a14741fa4fca05ee9b660490154bdb"
|
|
129
129
|
}
|