Skip to content

Commit

Permalink
chore: reverted checkbox changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajdeep Chandra authored and Rajdeep Chandra committed May 1, 2024
1 parent 0f01013 commit 12230c7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 75 deletions.
2 changes: 1 addition & 1 deletion packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@spectrum-web-components/shared": "^0.42.2"
},
"devDependencies": {
"@spectrum-css/checkbox": "^14.0.0-next.2"
"@spectrum-css/checkbox": "^8.1.5"
},
"types": "./src/index.d.ts",
"customElements": "custom-elements.json",
Expand Down
4 changes: 0 additions & 4 deletions packages/checkbox/src/Checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ export class Checkbox extends SizedMixin(CheckboxMixin(SpectrumElement), {
delegatesFocus: true,
};

override spectrumConfig = {
downstate: ['spectrum-two'],
};

/**
* Disable this control. It will not receive focus or events
*/
Expand Down
87 changes: 35 additions & 52 deletions packages/checkbox/src/spectrum-checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ governing permissions and limitations under the License.
--spectrum-checkbox-control-color-disabled: var(
--spectrum-disabled-content-color
);
--spectrum-checkbox-checkmark-color: var(--spectrum-gray-50);
--spectrum-checkbox-checkmark-color: var(--spectrum-gray-75);
--spectrum-checkbox-invalid-color-default: var(
--spectrum-negative-color-900
);
Expand Down Expand Up @@ -76,9 +76,7 @@ governing permissions and limitations under the License.
--spectrum-checkbox-control-size: var(
--spectrum-checkbox-control-size-medium
);
--spectrum-checkbox-control-corner-radius: var(
--spectrum-corner-radius-small-size-medium
);
--spectrum-checkbox-control-corner-radius: var(--spectrum-corner-radius-75);
--spectrum-checkbox-focus-indicator-gap: var(
--spectrum-focus-indicator-gap
);
Expand All @@ -97,9 +95,6 @@ governing permissions and limitations under the License.
}

:host([size='s']) {
--spectrum-checkbox-control-corner-radius: var(
--spectrum-corner-radius-small-size-small
);
--spectrum-checkbox-font-size: var(--spectrum-font-size-75);
--spectrum-checkbox-height: var(--spectrum-component-height-75);
--spectrum-checkbox-control-size: var(
Expand All @@ -109,10 +104,17 @@ governing permissions and limitations under the License.
--spectrum-checkbox-text-to-control: var(--spectrum-text-to-control-75);
}

:host([size='l']) {
--spectrum-checkbox-control-corner-radius: var(
--spectrum-corner-radius-small-size-large
:host {
--spectrum-checkbox-font-size: var(--spectrum-font-size-100);
--spectrum-checkbox-height: var(--spectrum-component-height-100);
--spectrum-checkbox-control-size: var(
--spectrum-checkbox-control-size-medium
);
--spectrum-checkbox-top-to-text: var(--spectrum-component-top-to-text-100);
--spectrum-checkbox-text-to-control: var(--spectrum-text-to-control-100);
}

:host([size='l']) {
--spectrum-checkbox-font-size: var(--spectrum-font-size-200);
--spectrum-checkbox-height: var(--spectrum-component-height-200);
--spectrum-checkbox-control-size: var(
Expand All @@ -123,9 +125,6 @@ governing permissions and limitations under the License.
}

:host([size='xl']) {
--spectrum-checkbox-control-corner-radius: var(
--spectrum-corner-radius-small-size-extra-large
);
--spectrum-checkbox-font-size: var(--spectrum-font-size-300);
--spectrum-checkbox-height: var(--spectrum-component-height-300);
--spectrum-checkbox-control-size: var(
Expand Down Expand Up @@ -181,13 +180,6 @@ governing permissions and limitations under the License.
);
}

:host(:not([readonly]):is(:active, [active])) #input:not(:disabled) + #box {
transform: perspective(
var(--spectrum-component-size-minimum-perspective-down)
)
translateZ(var(--spectrum-component-size-difference-down));
}

:host([invalid][invalid]) #input:checked + #box:before,
:host([invalid][invalid]) #box:before {
border-color: var(
Expand Down Expand Up @@ -348,36 +340,6 @@ governing permissions and limitations under the License.
}

@media (hover: hover) {
:host(:hover) #box:before {
border-color: var(
--highcontrast-checkbox-highlight-color-hover,
var(
--mod-checkbox-control-color-hover,
var(--spectrum-checkbox-control-color-hover)
)
);
}

:host(:hover) #input:checked + #box:before {
border-color: var(
--highcontrast-checkbox-highlight-color-hover,
var(
--mod-checkbox-control-selected-color-hover,
var(--spectrum-checkbox-control-selected-color-hover)
)
);
}

:host(:hover) #label {
color: var(
--highcontrast-checkbox-content-color-hover,
var(
--mod-checkbox-content-color-hover,
var(--spectrum-checkbox-content-color-hover)
)
);
}

:host([invalid][invalid]:hover) #input:checked + #box:before,
:host([invalid][invalid]:hover) #box:before {
border-color: var(
Expand Down Expand Up @@ -421,6 +383,27 @@ governing permissions and limitations under the License.
);
}

:host(:hover) #box:before {
border-color: var(
--highcontrast-checkbox-highlight-color-hover,
var(
--mod-checkbox-control-color-hover,
var(--spectrum-checkbox-control-color-hover)
)
);
}

:host(:hover) #input:checked + #box:before {
border-color: var(
--highcontrast-checkbox-highlight-color-hover,
var(
--mod-checkbox-control-selected-color-hover,
var(--spectrum-checkbox-control-selected-color-hover)
)
);
}

:host(:hover) #label,
:host([invalid][invalid][indeterminate]:hover) #label {
color: var(
--highcontrast-checkbox-content-color-hover,
Expand Down Expand Up @@ -470,8 +453,8 @@ governing permissions and limitations under the License.
}
}

:host([emphasized][indeterminate]:is(:active, [active])) #box:before,
:host([emphasized][indeterminate]:is(:active, [active]))
:host([emphasized]:is(:active, [active])[indeterminate]) #box:before,
:host([emphasized]:is(:active, [active])[indeterminate])
#input:checked
+ #box:before,
:host([emphasized]:is(:active, [active])) #input:checked + #box:before {
Expand Down
19 changes: 1 addition & 18 deletions packages/checkbox/src/spectrum-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

import {
builder,
converterFor,
} from '../../../tasks/process-spectrum-utils.js';
import { converterFor } from '../../../tasks/process-spectrum-utils.js';

const converter = converterFor('spectrum-Checkbox');

Expand Down Expand Up @@ -53,20 +50,6 @@ const config = {
],
],
},

hoist: true,
},
{
find: {
type: 'pseudo-class',
kind: 'not',
selectors: [[builder.class('is-readOnly')]],
},
replace: {
type: 'pseudo-class',
kind: 'not',
selectors: [[builder.attribute('readonly')]],
},
hoist: true,
},
converter.classToAttribute('is-readOnly', 'readonly'),
Expand Down

0 comments on commit 12230c7

Please sign in to comment.