keystone_ui 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/keystone_ui/line_chart_controller.js +4 -2
- data/app/components/keystone/ui/bottom_nav_component.rb +1 -1
- data/app/components/keystone/ui/breadcrumbs_component.rb +1 -1
- data/app/components/keystone/ui/desktop_back_link_component.rb +1 -1
- data/app/components/keystone/ui/mobile_actions_component.rb +1 -1
- data/app/components/keystone/ui/mobile_header_component.rb +1 -1
- data/app/components/keystone/ui/navbar_component.rb +1 -1
- data/app/components/keystone/ui/navigation_component.rb +2 -2
- data/lib/keystone_ui/version.rb +1 -1
- data/the_local/agents/keystone_ui-develop.md +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92d45d0ca72ce5a2128a391d80bd404bcfae53fc8cbef3a2a79ffaad716bcf1e
|
|
4
|
+
data.tar.gz: 48fc5e92e536ddd94a2ee7b60793f29a72969f3a9329ab86e8f6d66222c6dc2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dff8292ec2415468e2c63f54a12b12bd5a8dcca50313794b3ab5a78720cc1cec36e344044fa00cf3689932a86bc256c7edd94c5af6f01002d54f6d9b491efc0b
|
|
7
|
+
data.tar.gz: e226f99862c150bb1f8d2e81c03c66fb63ffb5a70e5e53759532eedde96767367a4f12873e46f34eccddf9603e8ecce3ccf52510d1aa59791bf7823342cc2d33
|
|
@@ -59,6 +59,8 @@ const LIGHT_THEMES = ["light", "custom"]
|
|
|
59
59
|
|
|
60
60
|
export const isDarkMode = (theme, prefersDark) => theme === "dark" || (prefersDark && !LIGHT_THEMES.includes(theme))
|
|
61
61
|
|
|
62
|
+
export const drawnDark = (element, prefersDark) => isDarkMode(element.closest("[data-theme]")?.dataset.theme, prefersDark)
|
|
63
|
+
|
|
62
64
|
const CHART_COLOR_COUNT = 5
|
|
63
65
|
|
|
64
66
|
const INHERITED_FONTS = ["", "inherit"]
|
|
@@ -86,7 +88,7 @@ export const styleDatasets = (datasets, theme, resolve) => {
|
|
|
86
88
|
|
|
87
89
|
export const watchTheme = ({ document, matchMedia, MutationObserver }, onChange) => {
|
|
88
90
|
const observer = new MutationObserver(onChange)
|
|
89
|
-
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme", "data-look"] })
|
|
91
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme", "data-look", "style"] })
|
|
90
92
|
observer.observe(document.head, { childList: true, subtree: true, characterData: true })
|
|
91
93
|
const darkPreference = matchMedia("(prefers-color-scheme: dark)")
|
|
92
94
|
darkPreference.addEventListener("change", onChange)
|
|
@@ -136,7 +138,7 @@ export default class extends Controller {
|
|
|
136
138
|
return match ? read(match[1]) || color : color
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
const dark =
|
|
141
|
+
const dark = drawnDark(this.element, matchMedia("(prefers-color-scheme: dark)").matches)
|
|
140
142
|
return { theme: themeColors(read, dark, styles.fontFamily), resolve }
|
|
141
143
|
}
|
|
142
144
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Keystone
|
|
4
4
|
module Ui
|
|
5
5
|
class BreadcrumbsComponent < ViewComponent::Base
|
|
6
|
-
CLASSES = "ks-mobile-header-back ks-breadcrumbs hidden lg:block text-sm"
|
|
6
|
+
CLASSES = "ks-mobile-header-back ks-breadcrumbs hidden lg:block text-sm print:hidden"
|
|
7
7
|
SEPARATOR = "›"
|
|
8
8
|
|
|
9
9
|
def initialize(trail:, current: nil)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Keystone
|
|
4
4
|
module Ui
|
|
5
5
|
class DesktopBackLinkComponent < ViewComponent::Base
|
|
6
|
-
CLASSES = "ks-mobile-header-back ks-page-back hidden lg:inline-flex items-center"
|
|
6
|
+
CLASSES = "ks-mobile-header-back ks-page-back hidden lg:inline-flex items-center print:hidden"
|
|
7
7
|
LABEL = "Back"
|
|
8
8
|
|
|
9
9
|
def initialize(url:)
|
|
@@ -9,7 +9,7 @@ module Keystone
|
|
|
9
9
|
</svg>
|
|
10
10
|
SVG
|
|
11
11
|
|
|
12
|
-
WRAPPER_CLASSES = "relative lg:hidden"
|
|
12
|
+
WRAPPER_CLASSES = "relative lg:hidden print:hidden"
|
|
13
13
|
BUTTON_CLASSES = "ks-action-menu-button"
|
|
14
14
|
DROPDOWN_CLASSES = "ks-action-menu hidden absolute right-0 z-50 w-48 origin-top-right"
|
|
15
15
|
|
|
@@ -15,7 +15,7 @@ module Keystone
|
|
|
15
15
|
</svg>
|
|
16
16
|
SVG
|
|
17
17
|
|
|
18
|
-
WRAPPER_CLASSES = "lg:hidden"
|
|
18
|
+
WRAPPER_CLASSES = "lg:hidden print:hidden"
|
|
19
19
|
BACK_LINK_CLASSES = "ks-mobile-header-back"
|
|
20
20
|
TITLE_CLASSES = "ks-mobile-header-title absolute left-1/2 -translate-x-1/2 lg:hidden truncate max-w-[60%]"
|
|
21
21
|
SUBTITLE_CLASSES = "ks-mobile-header-subtitle block text-xs truncate text-center"
|
|
@@ -5,9 +5,9 @@ require "keystone_ui/visible_navigation"
|
|
|
5
5
|
module Keystone
|
|
6
6
|
module Ui
|
|
7
7
|
class NavigationComponent < ViewComponent::Base
|
|
8
|
-
TOP_BAR_CLASSES = "hidden lg:block sticky top-0 z-40"
|
|
8
|
+
TOP_BAR_CLASSES = "hidden lg:block sticky top-0 z-40 print:hidden"
|
|
9
9
|
SIDEBAR_ROW_CLASSES = "lg:flex"
|
|
10
|
-
SIDEBAR_CLASSES = "ks-sidebar hidden lg:flex lg:sticky lg:top-0 lg:h-screen shrink-0 overflow-y-auto"
|
|
10
|
+
SIDEBAR_CLASSES = "ks-sidebar hidden lg:flex lg:sticky lg:top-0 lg:h-screen shrink-0 overflow-y-auto print:hidden"
|
|
11
11
|
SIDEBAR_LOGO_CLASSES = "ks-sidebar-logo"
|
|
12
12
|
SIDEBAR_GROUP_CLASSES = "flex flex-col"
|
|
13
13
|
SIDEBAR_GROUP_LABEL_CLASSES = "ks-sidebar-group-label"
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -198,6 +198,9 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
198
198
|
|
|
199
199
|
5. Wire navigation in the layout.
|
|
200
200
|
|
|
201
|
+
Every navigation component is left off a printed page, so a printed page or
|
|
202
|
+
a PDF holds only the page's content.
|
|
203
|
+
|
|
201
204
|
- `ui_navigation` takes no keywords and a block holding the page content, so
|
|
202
205
|
it goes around `yield`. It draws the tabs the app declares with
|
|
203
206
|
`config.navigation_group` as a top bar of menus from `lg:` up, then the
|