diff --git a/app/assets/styles.css b/app/assets/styles.css
index ad64046..910587e 100644
--- a/app/assets/styles.css
+++ b/app/assets/styles.css
@@ -8,12 +8,17 @@
--color-gray-dark: 66 66 66;
--color-gray: 97 97 97;
--color-gray-light: 199 199 199;
- --color-gray-lightest: 209 209 209;
+ --color-gray-lighter: 209 209 209;
+ --color-gray-lightest: 245 245 245;
}
body {
@apply text-gray-dark;
}
+
+ p {
+ @apply mb-4;
+ }
}
.royal-table {
diff --git a/app/components/button-group.hbs b/app/components/button-group.hbs
index 3bedb74..a1fafdd 100644
--- a/app/components/button-group.hbs
+++ b/app/components/button-group.hbs
@@ -1,7 +1,7 @@
{{yield
(hash
- button=(component "button" group=this onClick=this.buttonPressed)
+ Button=(component "button" group=this)
)
}}
diff --git a/app/components/button.js b/app/components/button.js
index 9885cf7..3d25859 100644
--- a/app/components/button.js
+++ b/app/components/button.js
@@ -1,14 +1,27 @@
import Component from '@glimmer/component';
-import { action } from '@ember/object';
+import { action, get } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { hbs } from 'ember-template-imports';
import { Loading } from 'ember-mdi';
import { on } from '@ember/modifier';
import eq from '../helpers/eq';
-export const commonClasses =
- 'inline-flex items-center px-3 py-2 leading-4 text-sm cursor-pointer border hover:opacity-80 active:opacity-60 focus:outline-none text-black border-gray-dark';
-export const primaryStyleClasses = 'text-primary border-primary';
+export const sizes = {
+ sm: 'text-sm py-0.5',
+ md: 'px-3 py-2',
+ lg: 'px-4 py-3',
+};
+
+export const iconSizes = {
+ sm: 18,
+ md: 22,
+ lg: 24,
+};
+
+export const styles = {
+ default: 'border rounded',
+ primary: 'border rounded text-primary border-primary',
+};
export default class ButtonComponent extends Component {
static template = hbs`
@@ -16,22 +29,20 @@ export default class ButtonComponent extends Component {
disabled={{this.disabled}}
type={{this.type}}
class="
- {{commonClasses}}
- {{if (eq this.style 'primary') primaryStyleClasses}}
- {{if @group 'first:rounded-l-md last:rounded-r-md' 'rounded-md'}}
+ inline-flex items-center justify-center
+ {{get sizes this.size}}
+ {{get styles this.style}}
"
...attributes
{{on 'click' this.handleClick}}
>
{{#if this.isPending}}
-
+
{{else if @icon}}
- <@icon class="mx-1" />
+ <@icon @size={{get iconSizes this.size}} />
{{/if}}
{{#if this.text}}
-
- {{this.text}}
-
+ {{this.text}}
{{/if}}
`;
@@ -43,7 +54,7 @@ export default class ButtonComponent extends Component {
}
get size() {
- return this.args.size ?? 'default';
+ return this.args.size ?? 'md';
}
get isActive() {
diff --git a/app/components/divider.hbs b/app/components/divider.hbs
new file mode 100644
index 0000000..ca66f1c
--- /dev/null
+++ b/app/components/divider.hbs
@@ -0,0 +1 @@
+
diff --git a/app/components/theme-toggler.hbs b/app/components/theme-toggler.hbs
new file mode 100644
index 0000000..eb21514
--- /dev/null
+++ b/app/components/theme-toggler.hbs
@@ -0,0 +1,13 @@
+
+ {{#each this.themes as |item|}}
+ {{#let (eq item.id this.theme) as |selected|}}
+
+ {{/let}}
+ {{/each}}
+
diff --git a/app/components/theme-toggler.js b/app/components/theme-toggler.js
new file mode 100644
index 0000000..94365de
--- /dev/null
+++ b/app/components/theme-toggler.js
@@ -0,0 +1,32 @@
+import { action } from '@ember/object';
+import Component from '@glimmer/component';
+import { inject as service } from '@ember/service';
+import { WhiteBalanceSunny, ThemeLightDark, WeatherNight } from 'ember-mdi';
+import { tracked } from '@glimmer/tracking';
+
+export default class ThemeTogglerComponent extends Component {
+ @service session;
+
+ @tracked theme;
+
+ constructor() {
+ super(...arguments);
+
+ this.theme = document.documentElement.dataset.theme;
+ }
+
+ get themes() {
+ return [
+ { id: 'light', name: 'Light', icon: WhiteBalanceSunny },
+ { id: 'system', name: 'System', icon: ThemeLightDark },
+ { id: 'dark', name: 'Dark', icon: WeatherNight },
+ ];
+ }
+
+ @action
+ changeTheme(theme) {
+ localStorage.setItem('theme', theme);
+ this.theme = theme;
+ document.documentElement.dataset.theme = theme;
+ }
+}
diff --git a/app/index.html b/app/index.html
index 442937f..33c4826 100644
--- a/app/index.html
+++ b/app/index.html
@@ -8,7 +8,7 @@
{{content-for "head"}}
-
+
{{content-for "head-footer"}}
diff --git a/app/templates/admin.hbs b/app/templates/admin.hbs
index b41e202..8f23836 100644
--- a/app/templates/admin.hbs
+++ b/app/templates/admin.hbs
@@ -11,7 +11,7 @@
'flex items-center px-4 py-2 font-semibold text-lg text-gray-dark'
as |classLink|
}}
-