-
Notifications
You must be signed in to change notification settings - Fork 7
feat(components): dlt-3096 add slot classes #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| > | ||
| <div | ||
| data-qa="dt-box-scrollbar-content" | ||
| class="d-box__scrollbar-content" | ||
| :class="['d-box__scrollbar-content', scrollbarContentClass]" | ||
| > | ||
| <!-- @slot Slot for main content --> | ||
| <slot /> | ||
|
|
@@ -221,6 +221,12 @@ const props = defineProps({ | |
| * @values hidden, scroll, auto, clip, visible | ||
| */ | ||
| overflow: { type: String, default: undefined, validator: overflowValidator }, | ||
|
|
||
| /** | ||
| * Additional CSS classes applied to the scrollbar content wrapper element. | ||
| * Only applies when scrollbar prop is set. | ||
| */ | ||
| scrollbarContentClass: { type: [String, Object, Array], default: '' }, | ||
|
Comment on lines
+224
to
+229
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Find all references to the new prop
rg -n -C2 '\bscrollbarContentClass\b'
# 2) Locate likely DtBox artifacts expected by repo conventions
fd -i 'box.vue'
fd -i 'box.test.js'
fd -i 'box.stories.js'
fd -i 'box.mdx'
fd -i '*box*.json'
fd -i '*box*.md'
# 3) Check whether those artifacts mention the new prop
rg -n -C2 '\bscrollbarContentClass\b' --iglob '*box*'Repository: dialpad/dialtone Length of output: 1891 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== 1. Check box.test.js for scrollbarContentClass ==="
rg -n 'scrollbarContentClass' packages/dialtone-vue/components/box/box.test.js || echo "Not found in test file"
echo -e "\n=== 2. Check box.stories.js for scrollbarContentClass ==="
rg -n 'scrollbarContentClass' packages/dialtone-vue/components/box/box.stories.js || echo "Not found in stories file"
echo -e "\n=== 3. Find box component docs JSON files ==="
find packages/dialtone-vue/components/box -name "*.json" -type f 2>/dev/null || echo "No JSON files found"
echo -e "\n=== 4. Find box component VuePress docs ==="
find . -path "*/docs*" -name "*box*" -type f 2>/dev/null | head -20
echo -e "\n=== 5. Search for MCP server data files ==="
find . -name "*mcp*" -o -name "*meta*" -o -name "*schema*" 2>/dev/null | grep -i box | head -10
echo -e "\n=== 6. Check if there's a component docs registry ==="
rg -l 'box.*component\|component.*box' --type json --type js 2>/dev/null | grep -i 'doc\|meta\|schema' | head -10Repository: dialpad/dialtone Length of output: 1573 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Check VuePress box.md for scrollbarContentClass ==="
rg -n 'scrollbarContentClass' ./apps/dialtone-documentation/docs/components/box.md || echo "Not found in VuePress docs"
echo -e "\n=== Check docs/_data/ for component metadata ==="
ls -la ./apps/dialtone-documentation/docs/_data/ 2>/dev/null || echo "Directory not found"
echo -e "\n=== Search for component JSON metadata files ==="
find ./apps/dialtone-documentation -name "*box*.json" -type f 2>/dev/null
echo -e "\n=== Search for MCP server or metadata patterns ==="
find . -type f -name "*.json" -exec rg -l '"box".*"props"|"scrollbarContentClass"' {} \; 2>/dev/null | head -5
echo -e "\n=== Check if docs/_data/checkbox.json shows the expected structure ==="
head -50 ./apps/dialtone-documentation/docs/_data/checkbox.json 2>/dev/null || echo "File not found"Repository: dialpad/dialtone Length of output: 5347 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Check box.test.js to see if it should document props ==="
head -80 packages/dialtone-vue/components/box/box.test.js
echo -e "\n=== Check box.stories.js to see if it should document props ==="
head -80 packages/dialtone-vue/components/box/box.stories.js
echo -e "\n=== Check if there are .mdx files for box component ==="
find packages/dialtone-vue/components/box -name "*.mdx" -type f
echo -e "\n=== Check for TypeScript definitions or prop documentation patterns ==="
find packages/dialtone-vue/components/box -type f | head -20Repository: dialpad/dialtone Length of output: 4570 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Search for complete argTypesData in box.stories.js ==="
rg -A 200 'argTypesData' packages/dialtone-vue/components/box/box.stories.js | grep -E '(scrollbar|}})'
echo -e "\n=== Check if scrollbar tests exist in box.test.js ==="
rg -n 'scrollbar' packages/dialtone-vue/components/box/box.test.js
echo -e "\n=== Check box.vue for full prop list with scrollbar ==="
rg -B 5 -A 5 'scrollbar' packages/dialtone-vue/components/box/box.vue | head -60
echo -e "\n=== Check if box.stories.js mentions scrollbarContent anywhere ==="
rg -n 'scrollbar' packages/dialtone-vue/components/box/box.stories.jsRepository: dialpad/dialtone Length of output: 118 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Read full box.stories.js file ==="
wc -l packages/dialtone-vue/components/box/box.stories.js
echo -e "\n=== Get argTypesData section from box.stories.js ==="
sed -n '/export const argTypesData/,/^}/p' packages/dialtone-vue/components/box/box.stories.js | tail -80
echo -e "\n=== Search for scrollbar in box.test.js ==="
rg -n 'scrollbar' packages/dialtone-vue/components/box/box.test.js || echo "No scrollbar tests found"
echo -e "\n=== List all props in box.vue ==="
sed -n '/defineProps/,/^[});]/p' packages/dialtone-vue/components/box/box.vue | head -100Repository: dialpad/dialtone Length of output: 7170 Update all DtBox artifacts for the new The prop was added to the Vue component but is missing from Storybook controls (
🤖 Prompt for AI Agents |
||
| }); | ||
|
|
||
| const SCROLLBAR_INCOMPATIBLE_ELEMENTS = ['ul', 'ol', 'span', 'fieldset']; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |
| { [BREADCRUMBS_INVERTED_MODIFIER]: inverted }, | ||
| ]" | ||
| > | ||
| <ol :class="['d-breadcrumbs__list']"> | ||
| <ol :class="['d-breadcrumbs__list', listClass]"> | ||
| <!-- @slot default slot for breadcrumbs content --> | ||
| <slot> | ||
| <dt-breadcrumb-item | ||
|
|
@@ -65,6 +65,14 @@ export default { | |
| default: false, | ||
| }, | ||
|
|
||
| /** | ||
| * Additional CSS class(es) applied to the list wrapper element. | ||
| */ | ||
| listClass: { | ||
| type: [String, Array, Object], | ||
| default: '', | ||
| }, | ||
|
Comment on lines
+68
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Verify references for newly introduced class props in this PR scope.
# Expected: references in component tests, stories, docs JSON/VuePress/MCP data where applicable.
echo "== Candidate component-related files =="
fd -i 'breadcrumbs|filter_pill' packages
echo "== Prop references in likely companion artifacts =="
rg -n -C2 --iglob '*breadcrumbs*' --iglob '*filter_pill*' '\b(listClass|labelClass)\b' packagesRepository: dialpad/dialtone Length of output: 3528 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Check for breadcrumbs test file =="
fd 'breadcrumbs' packages/dialtone-vue --type f | grep -i test
echo "== Search for listClass in breadcrumbs test (if exists) =="
find packages/dialtone-vue/components/breadcrumbs -name '*.test.js' -o -name '*.spec.js' | while read f; do
if [ -f "$f" ]; then
echo "Found: $f"
rg -n 'listClass' "$f" || echo "No listClass references found"
fi
done
echo "== Search for listClass in breadcrumbs story files =="
rg -n 'listClass' packages/dialtone-vue/components/breadcrumbs/ || echo "No listClass in breadcrumbs stories"
echo "== Check for component docs metadata files =="
find packages -name '*breadcrumbs*' -type f | grep -E '\.(json|mdx?)$' | head -20
echo "== Check for VuePress docs =="
find packages -path '*/docs/*' -name '*breadcrumb*' 2>/dev/null || echo "No VuePress breadcrumb docs found"
echo "== Check MCP server data =="
rg -l 'breadcrumbs' packages --type json | head -10Repository: dialpad/dialtone Length of output: 97 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== List all files in breadcrumbs directory =="
ls -la packages/dialtone-vue/components/breadcrumbs/
echo "== Check breadcrumbs.stories.js for listClass =="
rg -n 'listClass' packages/dialtone-vue/components/breadcrumbs/breadcrumbs.stories.js || echo "Not found in stories.js"
echo "== Check breadcrumbs story templates for listClass =="
rg -n 'listClass' packages/dialtone-vue/components/breadcrumbs/*.story.vue || echo "Not found in story.vue files"
echo "== Search for component docs/metadata files =="
find packages -name '*.json' -type f | xargs rg -l 'breadcrumbs' 2>/dev/null | head -5
echo "== Check for MDX documentation =="
find packages -name '*.mdx' -type f | xargs rg -l 'breadcrumbs' 2>/dev/null | head -5Repository: dialpad/dialtone Length of output: 1380 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Check breadcrumb.test.js for listClass =="
rg -n 'listClass' packages/dialtone-vue/components/breadcrumbs/breadcrumb.test.js || echo "Not found in breadcrumb.test.js"
echo "== Read breadcrumb.test.js to see what it tests =="
head -50 packages/dialtone-vue/components/breadcrumbs/breadcrumb.test.js
echo "== Search for component docs registry JSON =="
find packages/dialtone-vue -name '*docs*' -o -name '*registry*' -o -name '*components*' | grep -i json | head -10
echo "== Check dialtone-vue package for component metadata =="
ls -la packages/dialtone-vue/*.json 2>/dev/null || echo "No JSON files at package root"
echo "== Search for MCP data or VuePress in docs =="
find packages -type d -name 'docs' -o -type d -name '.mcp' | head -5Repository: dialpad/dialtone Length of output: 1204 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Search for all JSON files that might contain component metadata =="
find packages -type f -name '*.json' | xargs grep -l '"breadcrumbs"' 2>/dev/null | head -10
echo "== Check if there's a component registry or docs folder =="
ls -la packages/dialtone-vue/docs 2>/dev/null || echo "No docs folder at package root"
echo "== Look for .mdx files related to breadcrumbs =="
find packages -name '*.mdx' | xargs grep -l 'breadcrumb' 2>/dev/null || echo "No MDX breadcrumb docs"
echo "== Check breadcrumbs.stories.js content for completeness =="
cat -n packages/dialtone-vue/components/breadcrumbs/breadcrumbs.stories.js
echo "== Check breadcrumbs_variants.story.vue content =="
cat -n packages/dialtone-vue/components/breadcrumbs/breadcrumbs_variants.story.vueRepository: dialpad/dialtone Length of output: 131 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Direct read of breadcrumbs.stories.js =="
cat packages/dialtone-vue/components/breadcrumbs/breadcrumbs.stories.js
echo ""
echo "== Direct read of breadcrumbs_variants.story.vue =="
cat packages/dialtone-vue/components/breadcrumbs/breadcrumbs_variants.story.vue
echo ""
echo "== Check entire breadcrumb.test.js for prop coverage =="
cat packages/dialtone-vue/components/breadcrumbs/breadcrumb.test.js | head -100Repository: dialpad/dialtone Length of output: 5080 Add The new
Update argTypes to include 🤖 Prompt for AI Agents |
||
|
|
||
| /** | ||
| * Descriptive label for the navigation content. | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,14 +14,15 @@ | |
| > | ||
| <span | ||
| v-if="hasSlotContent($slots.icon)" | ||
| class="d-chip__icon" | ||
| :class="['d-chip__icon', iconClass]" | ||
| data-qa="dt-chip-icon" | ||
| > | ||
| <!-- @slot slot for Chip icon --> | ||
| <slot name="icon" /> | ||
| </span> | ||
| <span | ||
| v-else-if="hasSlotContent($slots.avatar)" | ||
| :class="avatarClass" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore the base avatar class in the wrapper binding. Line 25 drops the component’s base avatar class and can break default chip avatar styling. Keep the base class and append 🛠️ Proposed fix- :class="avatarClass"
+ :class="['d-chip__avatar', avatarClass]"Also applies to: 166-172 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a bug. The original avatar span had no base class (), and no d-chip__avatar CSS class exists. :class="avatarClass" is correct.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(ᵔᴥᵔ) ✏️ Learnings added
🧠 Learnings used |
||
| data-qa="dt-chip-avatar" | ||
| > | ||
| <!-- @slot slot for Chip avatar --> | ||
|
|
@@ -153,6 +154,22 @@ export default { | |
| type: [String, Array, Object], | ||
| default: '', | ||
| }, | ||
|
|
||
| /** | ||
| * Additional class name for the icon wrapper element. | ||
| */ | ||
| iconClass: { | ||
| type: [String, Array, Object], | ||
| default: '', | ||
| }, | ||
|
|
||
| /** | ||
| * Additional class name for the avatar wrapper element. | ||
| */ | ||
| avatarClass: { | ||
| type: [String, Array, Object], | ||
| default: '', | ||
| }, | ||
| }, | ||
|
|
||
| emits: [ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.