diff --git a/.changeset/flat-shirts-battle.md b/.changeset/flat-shirts-battle.md new file mode 100644 index 00000000..2a460fc8 --- /dev/null +++ b/.changeset/flat-shirts-battle.md @@ -0,0 +1,5 @@ +--- +"mx-ui-components": minor +--- + +feat: dark/light consistency across mox components diff --git a/addon/components/mox/article.hbs b/addon/components/mox/article.hbs index efb5d8c6..90213bde 100644 --- a/addon/components/mox/article.hbs +++ b/addon/components/mox/article.hbs @@ -1,7 +1,7 @@
{{yield}} -
\ No newline at end of file + diff --git a/addon/components/mox/card.hbs b/addon/components/mox/card.hbs index 65c39387..2844454e 100644 --- a/addon/components/mox/card.hbs +++ b/addon/components/mox/card.hbs @@ -1,5 +1,5 @@
@@ -8,16 +8,25 @@ {{#if (has-block "icon")}} -
+
{{yield to="icon"}}
{{/if}}
-

+

{{yield to="title"}}

-

+

{{yield to="subtitle"}}

@@ -36,7 +45,6 @@ {{/if}} - {{#if (has-block "menu")}}
{{@label}} {{/if}} -
+
+ {{yield}} {{else}} {{yield}} -{{/if}} \ No newline at end of file +{{/if}} diff --git a/addon/components/mox/modal.hbs b/addon/components/mox/modal.hbs index c4561d07..7f0f2ce5 100644 --- a/addon/components/mox/modal.hbs +++ b/addon/components/mox/modal.hbs @@ -1,5 +1,5 @@
diff --git a/addon/components/mox/select.hbs b/addon/components/mox/select.hbs index 1ae742bf..c5bbd9be 100644 --- a/addon/components/mox/select.hbs +++ b/addon/components/mox/select.hbs @@ -36,7 +36,7 @@ {{#if this.isShowingOptions}}
    -
\ No newline at end of file +
diff --git a/addon/components/mox/theme-switch.hbs b/addon/components/mox/theme-switch.hbs index abafe176..8143c1b2 100644 --- a/addon/components/mox/theme-switch.hbs +++ b/addon/components/mox/theme-switch.hbs @@ -1,18 +1,20 @@
-
- {{!-- template-lint-disable require-input-label --}} +
+ {{! template-lint-disable require-input-label }} - {{!-- template-lint-disable require-input-label --}} -
+ {{! template-lint-disable require-input-label }} +
{{#if (eq this.currentTheme "dark")}}
{{yield to="dark-icon"}} diff --git a/addon/components/mox/toggle.hbs b/addon/components/mox/toggle.hbs index 15056883..6eb9d317 100644 --- a/addon/components/mox/toggle.hbs +++ b/addon/components/mox/toggle.hbs @@ -7,6 +7,7 @@ checked={{this.isChecked}} {{on "change" this.toggleAction}} data-test-mox-toggle + disabled={{@isDisabled}} /> {{#if @label}}
-
\ No newline at end of file +
diff --git a/addon/components/mxa/select.hbs b/addon/components/mxa/select.hbs index 71aa828f..6fa45556 100644 --- a/addon/components/mxa/select.hbs +++ b/addon/components/mxa/select.hbs @@ -6,22 +6,23 @@ aria-expanded="true" aria-labelledby="listbox-label" class="relative w-full - {{if @isDisabled 'bg-gray-100 border-gray-100 text-gray-500' 'bg-white border-gray-300 focus:border-purple-600 focus:ring-purple-600 focus:ring-1'}} - border rounded shadow-sm pl-3 pr-10 py-2 text-left cursor-default - focus:outline-none sm:text-sm" + {{if + @isDisabled + 'bg-gray-100 border-gray-100 text-gray-500' + 'bg-white border-gray-300 focus:border-purple-600 focus:ring-purple-600 focus:ring-1' + }} + border rounded shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none sm:text-sm" data-test-select-button ...attributes - {{on 'click' this.toggleOptions}} + {{on "click" this.toggleOptions}} > {{this.selectedOptionName}} - - {{!-- Heroicon name: selector --}} + + {{! Heroicon name: selector }} - {{!-- + {{! Select popover, show/hide based on select state. Entering: "" @@ -46,15 +47,11 @@ Leaving: "transition ease-in duration-100" From: "opacity-100" To: "opacity-0" - --}} + }} {{#if this.isShowingOptions}}
    {{/each}} {{/if}} - {{!-- + {{! Select option, manage highlight styles based on mouseenter/mouseleave and keyboard navigation. Highlighted: "text-white bg-indigo-600", Not Highlighted: "text-gray-900" - --}} + }}
{{/if}} diff --git a/addon/components/mxa/tags-input.hbs b/addon/components/mxa/tags-input.hbs index b59ce40d..5f4177c5 100644 --- a/addon/components/mxa/tags-input.hbs +++ b/addon/components/mxa/tags-input.hbs @@ -20,7 +20,7 @@ data-test-tags-selected={{tag}} > {{tag}} - {{!-- template-lint-disable no-invalid-interactive --}} + {{! template-lint-disable no-invalid-interactive }} - {{!-- template-lint-enable no-invalid-interactive --}} + {{! template-lint-enable no-invalid-interactive }}
{{/each}}
@@ -45,7 +45,7 @@
{{#if this.foundTags}} -
+
    +
    {{#if @label}} {{@label}} {{/if}}
    - +
    - {{!-- template-lint-disable no-positive-tabindex --}} + {{! template-lint-disable no-positive-tabindex }}
      - {{!-- template-lint-enable no-positive-tabindex --}} + {{! template-lint-enable no-positive-tabindex }} {{#each this.matches as |match idx|}} - {{!-- template-lint-disable require-presentational-children --}} + {{! template-lint-disable require-presentational-children }}
    • - {{!-- template-lint-disable no-invalid-interactive --}} + {{! template-lint-disable no-invalid-interactive }}
      - + {{get match this.optionNameKey}}
      - {{!-- template-lint-enable no-invalid-interactive --}} - {{#if - (eq - (get match this.optionValueKey) - (get @selectedOption this.optionValueKey) - ) - }} + {{! template-lint-enable no-invalid-interactive }} + {{#if (eq (get match this.optionValueKey) (get @selectedOption this.optionValueKey))}} {{/if}}
    • - {{!-- template-lint-enable require-presentational-children --}} + {{! template-lint-enable require-presentational-children }} {{/each}}
    diff --git a/addon/styles/mx-ui-components.css b/addon/styles/mx-ui-components.css index 3a8c017b..4d2d3118 100644 --- a/addon/styles/mx-ui-components.css +++ b/addon/styles/mx-ui-components.css @@ -1,24 +1,13 @@ -.mox-theme-switch input { - height: 1.5rem; - width: 2.5rem; - outline: 2px solid #e5e7eb; /* bg-gray-200 */ - background-color: #e5e7eb; /* bg-gray-200 */ - outline-offset: 0; - border: none; -} - .mox-toggle input { height: 1.3rem; width: 2.6rem; } -.mox-theme-switch input:checked, .mox-toggle input:checked, .mxa-toggle input:checked { background-image: none; } -.mox-theme-switch input::after, .mox-toggle input::after, .mxa-toggle input::after { content: ''; @@ -35,11 +24,6 @@ transition-timing-function: ease-in-out; } -.mox-theme-switch input::after, -.mxa-toggle input::after { - background-color: #fff; -} - .mox-toggle input::after { height: 15px; width: 15px; @@ -48,51 +32,12 @@ } .mxa-toggle input::after { + background-color: #fff; height: 20px; width: 20px; top: 1px; } -.mox-theme-switch input:checked { - background-color: #1f2937; /* bg-gray-800 */ - outline: 2px solid #1f2937; /* bg-gray-800 */ - color: #1f2937; /* bg-gray-800 */ -} - -.mox-theme-switch input:focus { - outline: 2px solid #06b6d4; - box-shadow: none; - outline-offset: 0; -} - -.mox-theme-switch input::after { - height: 18px; - width: 18px; - top: 3px; - left: 3px; -} - -.mox-theme-switch-icon { - position: absolute; - left: -4px; - top: 4px; - right: auto; - display: block; - outline: none; - transform: translateX(0); - transition: transform 0.15s; - transition-timing-function: ease-in-out; -} - -.mox-theme-switch input:checked::after, -.mox-theme-switch-icon.is-checked { - transform: translateX(15px); -} - -.mox-theme-switch input:checked::after { - background-color: transparent; -} - .mox-toggle input:checked::after, .mxa-toggle input:checked::after { transform: translateX(20px); @@ -170,7 +115,7 @@ a.arg-active.mox-tab-link:hover { a.active.mox-link-button, a.active.mox-link-button:hover { - background-color: #d1d5db; /* gray-300 */ + background-color: #e5e7eb; /* gray-200 */ color: #1f2937; /* gray-800 */ }