@webority/theme 0.107.0 → 0.108.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.
@@ -1,110 +0,0 @@
1
- // ── Menubar ──
2
- // AppMenubar / <app-menubar> (a <wui-menubar> element): an application menubar (File, Edit, View).
3
- // A top menu is a Bootstrap .dropdown-menu with .dropdown-item rows, so the look, the danger tone
4
- // and the icon treatment come from the shared dropdown styles; this partial adds the bar, the
5
- // triggers and the placement. The element shows a panel with [data-open] (never `.show`, which a
6
- // React re-render would reset). A top panel is placed by the element with position: fixed, so it
7
- // escapes any clipping ancestor; a submenu is absolute against its row and flips to the left at
8
- // the viewport edge through [data-side="start"]. Every colour is a theme token.
9
- //
10
- // Part of the wui-components layer, see _wui-components.scss for load order.
11
-
12
- wui-menubar {
13
- display: flex;
14
- flex-wrap: wrap;
15
- align-items: center;
16
- gap: 2px;
17
- min-width: 0;
18
- }
19
-
20
- .wui-menubar-trigger {
21
- padding: 6px 10px;
22
- border: 0;
23
- border-radius: var(--wui-radius-sm);
24
- background: transparent;
25
- color: var(--color-text);
26
- font: inherit;
27
- font-size: 14px;
28
- font-weight: 500;
29
- line-height: 1.2;
30
- white-space: nowrap;
31
- cursor: pointer;
32
-
33
- &:hover,
34
- &[aria-expanded="true"] {
35
- background: var(--color-bg-muted);
36
- }
37
- &:focus-visible {
38
- outline: var(--wui-focus-ring-width) solid var(--color-focus-ring);
39
- outline-offset: 1px;
40
- }
41
- &[aria-disabled="true"] {
42
- background: transparent;
43
- color: var(--color-text-subtle);
44
- cursor: default;
45
- }
46
- }
47
-
48
- .dropdown-menu.wui-menubar-panel {
49
- position: fixed;
50
- // Above a modal, like every other portalled menu (see --wui-z-* in _tokens.scss).
51
- z-index: var(--wui-z-menu);
52
- min-width: 14rem;
53
- outline: none;
54
- transform-origin: top left;
55
-
56
- &[data-open] {
57
- display: block;
58
- animation: var(--wui-menu-anim) var(--wui-menu-anim-duration) var(--wui-menu-anim-ease);
59
- }
60
- &.drop-up {
61
- --wui-menu-drop: 6px;
62
-
63
- transform-origin: bottom left;
64
- }
65
-
66
- .dropdown-item:focus-visible {
67
- outline: var(--wui-focus-ring-width) solid var(--color-focus-ring);
68
- outline-offset: var(--wui-focus-ring-inset);
69
- }
70
- // Listed but unchoosable: quiet, and no hover tint.
71
- .dropdown-item[aria-disabled="true"] {
72
- color: var(--color-text-subtle);
73
- cursor: default;
74
- background: transparent;
75
- }
76
- // The row whose submenu is open keeps its tint while focus is inside the submenu.
77
- .dropdown-item[aria-expanded="true"] {
78
- background: var(--color-bg-muted);
79
- }
80
- }
81
-
82
- .wui-menubar-sub {
83
- position: relative;
84
- }
85
- .dropdown-menu.wui-menubar-subpanel {
86
- // The element sets --wui-menubar-sub-offset when the submenu would run past the bottom edge.
87
- position: absolute;
88
- top: calc(var(--wui-menubar-sub-offset, 0px) - 5px);
89
- right: auto;
90
- bottom: auto;
91
- left: 100%;
92
- transform-origin: top left;
93
-
94
- &[data-side="start"] {
95
- right: 100%;
96
- left: auto;
97
- transform-origin: top right;
98
- }
99
- }
100
- // The submenu marker; a shortcut chip never sits on the same row.
101
- .wui-menubar-subtrigger > .wui-menubar-chevron {
102
- flex: none;
103
- margin-left: auto;
104
- }
105
-
106
- @media (prefers-reduced-motion: reduce) {
107
- .dropdown-menu.wui-menubar-panel[data-open] {
108
- animation: none;
109
- }
110
- }