-
Notifications
You must be signed in to change notification settings - Fork 7
feat(combinator): DLT-3312 preview resolved value in sized props #1199
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
Merged
Francis Rupert (francisrupert)
merged 29 commits into
next
from
combinator-show-rendered-value
Apr 17, 2026
Merged
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5c892f9
preview resolved value
francisrupert 7fa224e
resolved value for dt-text
francisrupert 43cd427
preview resolved value
francisrupert 374ae9a
add component-size token resolution
francisrupert 81cff9f
preview resolved value
francisrupert f6c4cf7
coerce option values to strings for comparison
francisrupert cc009f9
manage exclusions
francisrupert 04c300b
add tooltip for font-size/line-height resolved values
francisrupert cfe04b8
extract condition checking into helper function
francisrupert b5bd9d0
tests
francisrupert 6b8aae7
improve measurement element positioning to prevent layout shifts
francisrupert aac57a4
filter out defaults key from variant options
francisrupert 165e24f
add color swatches to selection control for color token values
francisrupert 3b855ba
add color token resolution with support for multiple class patterns aโฆ
francisrupert 5be19fa
Merge branch 'next' into combinator-show-rendered-value
francisrupert 8ef064e
add color token resolution with support for multiple class patterns aโฆ
francisrupert 076198c
adjust controls panel width and update null value label to en dash
francisrupert 65320c8
improve BEM modifier pattern matching to support nested modifiers andโฆ
francisrupert 1c4e7e1
Merge branch 'next' into combinator-show-rendered-value
francisrupert d2c4439
update tone tokenCategory to use text-tone design token rather than dโฆ
francisrupert 53c3859
add mutual exclusivity rules for button muted kind and primary importโฆ
francisrupert ba1dfc6
reorder prop priority list to place importance before kind and add shโฆ
francisrupert d6d35ee
add mutual exclusivity rules
francisrupert 59c5be2
update rich text editor notice to use GFM alert syntax
francisrupert 2451a0f
use place-items shorthand and add component-content wrapper with dispโฆ
francisrupert be5393b
variant config housekeeping
francisrupert 467367c
skip showDivider from prop dependency detection
francisrupert b05e843
remove 625 from stack gap prop values documentation
francisrupert ec48cd7
add token cache clearing on theme change
francisrupert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import { assert } from 'chai'; | ||
| import { shouldExclude, getDisabledValues } from './exclusion_rules'; | ||
|
|
||
| const EQUALITY_RULE = { when: { kind: 'body' }, disableValues: { props: { size: ['500'] } } }; | ||
| const PREDICATE_RULE = { when: { kind: v => v !== 'headline' }, disableValues: { props: { size: ['500'] } } }; | ||
| const HIDE_RULE = { when: { kind: 'count' }, hide: { props: ['decoration'] } }; | ||
|
|
||
| describe('exclusion_rules', function () { | ||
| describe('getDisabledValues', function () { | ||
| it('should return empty Set when no rules', function () { | ||
| assert.equal(getDisabledValues('size', [], { kind: 'body' }).size, 0); | ||
| }); | ||
|
|
||
| it('should return empty Set when rules is undefined', function () { | ||
| assert.equal(getDisabledValues('size', undefined, { kind: 'body' }).size, 0); | ||
| }); | ||
|
|
||
| it('should contain value when equality condition matches', function () { | ||
| assert.isTrue(getDisabledValues('size', [EQUALITY_RULE], { kind: 'body' }).has('500')); | ||
| }); | ||
|
|
||
| it('should return empty Set when equality condition does not match', function () { | ||
| assert.equal(getDisabledValues('size', [EQUALITY_RULE], { kind: 'headline' }).size, 0); | ||
| }); | ||
|
|
||
| it('should contain value when predicate condition matches', function () { | ||
| assert.isTrue(getDisabledValues('size', [PREDICATE_RULE], { kind: 'body' }).has('500')); | ||
| }); | ||
|
|
||
| it('should return empty Set when predicate condition does not match', function () { | ||
| assert.equal(getDisabledValues('size', [PREDICATE_RULE], { kind: 'headline' }).size, 0); | ||
| }); | ||
|
|
||
| it('should union disabled values across multiple matching rules', function () { | ||
| const rules = [ | ||
| { when: { kind: 'body' }, disableValues: { props: { size: ['500'] } } }, | ||
| { when: { kind: 'body' }, disableValues: { props: { size: ['600'] } } }, | ||
| ]; | ||
| assert.equal(getDisabledValues('size', rules, { kind: 'body' }).size, 2); | ||
| }); | ||
|
|
||
| it('should coerce numeric values to strings', function () { | ||
| const rules = [ | ||
| { when: { kind: 'body' }, disableValues: { props: { size: [500] } } }, | ||
| ]; | ||
| assert.isTrue(getDisabledValues('size', rules, { kind: 'body' }).has('500')); | ||
| }); | ||
|
|
||
| it('should return empty Set for a prop not in disableValues', function () { | ||
| assert.equal(getDisabledValues('tone', [EQUALITY_RULE], { kind: 'body' }).size, 0); | ||
| }); | ||
|
|
||
| it('should ignore rules that only have hide', function () { | ||
| assert.equal(getDisabledValues('decoration', [HIDE_RULE], { kind: 'count' }).size, 0); | ||
| }); | ||
| }); | ||
|
|
||
| describe('shouldExclude', function () { | ||
| it('should return false when no rules', function () { | ||
| assert.isFalse(shouldExclude('size', 'props', [], {})); | ||
| }); | ||
|
|
||
| it('should return true when condition matches and member is in hide list', function () { | ||
| assert.isTrue(shouldExclude('decoration', 'props', [HIDE_RULE], { kind: 'count' })); | ||
| }); | ||
|
|
||
| it('should return false when condition does not match', function () { | ||
| assert.isFalse(shouldExclude('decoration', 'props', [HIDE_RULE], { kind: 'label' })); | ||
| }); | ||
|
|
||
| it('should return false when member is not in hide list', function () { | ||
| assert.isFalse(shouldExclude('size', 'props', [HIDE_RULE], { kind: 'count' })); | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.