Skip to content

refactor(millercolumns)!: tokens migration #2191

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
merged 6 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions components/assetlist/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ export const AssetListItem = ({
@click=${onclick}
tabindex="0"
>
${Checkbox({
${when(isSelectable, () =>
Checkbox({
...globals,
size: "m",
isChecked: isSelected,
customClasses: [`${rootClass}Selector`],
})}
}))}
${when(
image,
() =>
Expand All @@ -53,6 +54,13 @@ export const AssetListItem = ({
})
)}
${when(label, () => html`<span class="${rootClass}Label">${label}</span>`)}
${when(!isSelectable && !isBranch, () =>
Checkbox({
...globals,
size: "m",
isChecked: isSelected,
customClasses: [`${rootClass}Selector`],
}))}
${when(isBranch, () =>
Icon({
iconName: "ChevronRight100",
Expand Down
2 changes: 1 addition & 1 deletion components/miller/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require("@spectrum-css/component-builder");
module.exports = require('@spectrum-css/component-builder-simple');
13 changes: 8 additions & 5 deletions components/miller/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,31 @@ governing permissions and limitations under the License.
*/

.spectrum-MillerColumns {
--spectrum-millercolumn-margin: 8px;
--spectrum-millercolumns-inline-size: 272px;
--spectrum-millercolumns-padding: var(--spectrum-spacing-100);
--spectrum-millercolumns-margin-inline-start: var(--spectrum-spacing-100);
--spectrum-millercolumns-margin-inline-end: var(--spectrum-spacing-100);
}

.spectrum-MillerColumns {
overflow-x: auto;
white-space: nowrap;
user-select: none;
padding: var(--spectrum-millercolumn-margin) 0;
padding: var(--mod-millercolumns-padding, var(--spectrum-millercolumns-padding)) 0;
}

.spectrum-MillerColumns-item {
display: inline-block;
inline-size: var(--spectrum-millercolumn-width);
inline-size: var(--mod-millercolumns-inline-size, var(--spectrum-millercolumns-inline-size));
vertical-align: top;
outline: none;
margin: 0;
padding: 0;
margin-inline-end: var(--spectrum-millercolumn-margin);
margin-inline-end: var(--mod-millercolumns-margin-inline-end, var(--spectrum-millercolumns-margin-inline-end));
overflow: auto;
block-size: 100%;

&:first-child {
margin-inline-start: var(--spectrum-millercolumn-margin);
margin-inline-start: var(--mod-millercolumns-margin-inline-start, var(--spectrum-millercolumns-margin-inline-start));
}
}
50 changes: 25 additions & 25 deletions components/miller/metadata/miller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,42 @@ examples:
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-0">
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<span class="spectrum-AssetList-itemLabel">File 1</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item is-branch is-selectable is-selected" tabindex="0">
<label class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-AssetList-itemSelector">
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-1" checked>
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<span class="spectrum-AssetList-itemLabel">File 2</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item is-branch is-selectable" tabindex="0">
<label class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-AssetList-itemSelector">
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-2">
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<img src="img/example-ava.jpg" class="spectrum-AssetList-itemThumbnail">
<img src="img/example-ava.jpg" alt="asset item thumbnail" class="spectrum-AssetList-itemThumbnail">
<span class="spectrum-AssetList-itemLabel">File 3</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
</ul>
Expand All @@ -59,42 +59,42 @@ examples:
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-0">
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<span class="spectrum-AssetList-itemLabel">File 1</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item is-selectable is-selected" tabindex="0">
<label class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-AssetList-itemSelector">
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-1" checked>
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<span class="spectrum-AssetList-itemLabel">File 2</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item is-selectable is-selected" tabindex="0">
<label class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-AssetList-itemSelector">
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-2" checked>
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<img src="img/example-ava.jpg" class="spectrum-AssetList-itemThumbnail">
<img src="img/example-ava.jpg" alt="asset item thumbnail" class="spectrum-AssetList-itemThumbnail">
<span class="spectrum-AssetList-itemLabel">File 3</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
</ul>
Expand All @@ -110,7 +110,7 @@ examples:
<li class="spectrum-AssetList-item is-branch" tabindex="0">
<span class="spectrum-AssetList-itemLabel">File 1</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item" tabindex="0">
Expand All @@ -119,20 +119,20 @@ examples:
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-1">
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item is-navigated is-branch" tabindex="0">
<img src="img/example-ava.jpg" class="spectrum-AssetList-itemThumbnail">
<img src="img/example-ava.jpg" alt="asset item thumbnail" class="spectrum-AssetList-itemThumbnail">
<span class="spectrum-AssetList-itemLabel">File 3</span></span>

<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
</ul>
Expand All @@ -143,7 +143,7 @@ examples:
<li class="spectrum-AssetList-item is-branch" tabindex="0">
<span class="spectrum-AssetList-itemLabel">File 1</span>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item" tabindex="0">
Expand All @@ -152,27 +152,27 @@ examples:
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-1">
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
<li class="spectrum-AssetList-item is-selected" tabindex="0">
<img src="img/example-ava.jpg" class="spectrum-AssetList-itemThumbnail">
<img src="img/example-ava.jpg" alt="asset item thumbnail" class="spectrum-AssetList-itemThumbnail">
<span class="spectrum-AssetList-itemLabel">File 3</span>
<label class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-AssetList-itemSelector">
<input type="checkbox" class="spectrum-Checkbox-input" id="checkbox-2" checked>
<span class="spectrum-Checkbox-box">
<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Checkmark100" />
<use xlink:href="#spectrum-css-icon-Checkmark100"/>
</svg>
</span>
</label>
<svg class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-AssetList-itemChildIndicator" focusable="false" aria-hidden="true">
<use xlink:href="#spectrum-css-icon-Chevron100" />
<use xlink:href="#spectrum-css-icon-Chevron100"/>
</svg>
</li>
</ul>
Expand Down
6 changes: 6 additions & 0 deletions components/miller/metadata/mods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
| Modifiable Custom Properties |
| ----------------------------------------- |
| `--mod-millercolumns-inline-size` |
| `--mod-millercolumns-margin-inline-end` |
| `--mod-millercolumns-margin-inline-start` |
| `--mod-millercolumns-padding` |
4 changes: 2 additions & 2 deletions components/miller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"devDependencies": {
"@spectrum-css/assetlist": "^3.0.85",
"@spectrum-css/checkbox": "^7.0.15",
"@spectrum-css/component-builder": "^4.0.14",
"@spectrum-css/component-builder-simple": "^2.0.17",
"@spectrum-css/icon": "^4.0.3",
"@spectrum-css/vars": "^9.0.8",
"@spectrum-css/tokens": "^11.3.7",
"gulp": "^4.0.0"
},
"publishConfig": {
Expand Down
16 changes: 16 additions & 0 deletions components/miller/themes/express.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

@container (--system: express) {
.spectrum-MillerColumns {
}
}
16 changes: 16 additions & 0 deletions components/miller/themes/spectrum.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

@container (--system: spectrum) {
.spectrum-MillerColumns {
}
}