@guildofgleks/ui 21.4.3 → 21.5.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,170 +1,212 @@
1
- .gog-inline-center {
2
- display: inline-flex;
3
- align-items: center;
4
- justify-content: center;
5
- }
6
-
7
- .gog-flex-center {
8
- display: flex;
9
- align-items: center;
10
- justify-content: center;
11
- }
12
-
13
- /*
14
- * Scopes reflow to this subtree. Never put it on an element that has to paint something
15
- * outside its own box — `contain: layout` creates a stacking context, so a popup inside
16
- * it can no longer stack above the rest of the page no matter its z-index. That rules it
17
- * out for gog-select and gog-multiselect.
18
- */
19
- .gog-contained-layout {
20
- contain: layout style;
21
- }
22
-
23
- .gog-cursor-pointer {
24
- cursor: pointer;
25
- }
26
-
27
- .gog-cursor-wait {
28
- cursor: wait;
29
- }
30
-
31
- .gog-cursor-not-allowed {
32
- cursor: not-allowed;
33
- }
34
-
35
- /*
36
- * Present to assistive tech, invisible on screen. The clip-path/1px recipe rather than
37
- * `display: none` or `visibility: hidden`, both of which remove the text from the
38
- * accessibility tree along with the pixels.
39
- */
40
- .gog-visually-hidden {
41
- position: absolute;
42
- width: 1px;
43
- height: 1px;
44
- margin: -1px;
45
- padding: 0;
46
- border: 0;
47
- overflow: hidden;
48
- clip-path: inset(50%);
49
- white-space: nowrap;
50
- }
51
-
52
- /*
53
- * `gogBadge`'s classes, global for the same reason as `gog-collapsible`'s below: the
54
- * directive appends its badge into a *consumer's* element, which is light DOM belonging to
55
- * that consumer's view, so a scoped stylesheet could never reach it.
56
- */
57
- .gog-badge-host {
58
- /* The badge is positioned against this element, so it has to be a containing block.
59
- Harmless on an already-relative host; a host that is itself absolutely positioned
60
- should set its own position after this class, which ordinary specificity allows. */
61
- position: relative;
62
- }
63
-
64
- .gog-badge {
65
- position: absolute;
66
- z-index: var(--gog-badge-z);
67
- display: inline-flex;
68
- align-items: center;
69
- justify-content: center;
70
- box-sizing: border-box;
71
- min-width: var(--gog-badge-size);
72
- height: var(--gog-badge-size);
73
- padding-inline: var(--gog-badge-padding-inline);
74
- border: var(--gog-badge-border-width) var(--gog-badge-border-style) var(--gog-badge-border-color);
75
- border-radius: var(--gog-badge-radius);
76
- background-color: var(--gog-badge-bg, var(--gog-badge-variant-bg, var(--gog-badge-danger-bg)));
77
- color: var(--gog-badge-color, var(--gog-badge-variant-color, var(--gog-badge-danger-color)));
78
- font-family: var(--gog-badge-font-family);
79
- font-size: var(--gog-badge-font-size);
80
- font-weight: var(--gog-badge-font-weight);
81
- line-height: var(--gog-badge-line-height);
82
- pointer-events: none;
83
- white-space: nowrap;
84
- }
85
-
86
- /* A dot carries no text, so it collapses to a circle and drops its padding. */
87
- .gog-badge--dot {
88
- min-width: var(--gog-badge-dot-size);
89
- width: var(--gog-badge-dot-size);
90
- height: var(--gog-badge-dot-size);
91
- padding-inline: 0;
92
- border-radius: 50%;
93
- }
94
-
95
- /* Logical insets rather than a translate, so the corners follow the writing direction. */
96
- .gog-badge--top-end {
97
- top: calc(-1 * var(--gog-badge-offset));
98
- inset-inline-end: calc(-1 * var(--gog-badge-offset));
99
- }
100
-
101
- .gog-badge--top-start {
102
- top: calc(-1 * var(--gog-badge-offset));
103
- inset-inline-start: calc(-1 * var(--gog-badge-offset));
104
- }
105
-
106
- .gog-badge--bottom-end {
107
- bottom: calc(-1 * var(--gog-badge-offset));
108
- inset-inline-end: calc(-1 * var(--gog-badge-offset));
109
- }
110
-
111
- .gog-badge--bottom-start {
112
- bottom: calc(-1 * var(--gog-badge-offset));
113
- inset-inline-start: calc(-1 * var(--gog-badge-offset));
114
- }
115
-
116
- .gog-badge--success {
117
- --gog-badge-variant-bg: var(--gog-badge-success-bg);
118
- --gog-badge-variant-color: var(--gog-badge-success-color);
119
- }
120
-
121
- .gog-badge--danger {
122
- --gog-badge-variant-bg: var(--gog-badge-danger-bg);
123
- --gog-badge-variant-color: var(--gog-badge-danger-color);
124
- }
125
-
126
- .gog-badge--warning {
127
- --gog-badge-variant-bg: var(--gog-badge-warning-bg);
128
- --gog-badge-variant-color: var(--gog-badge-warning-color);
129
- }
130
-
131
- .gog-badge--info {
132
- --gog-badge-variant-bg: var(--gog-badge-info-bg);
133
- --gog-badge-variant-color: var(--gog-badge-info-color);
134
- }
135
-
136
- /*
137
- * `gog-collapsible`'s trigger/content classes, global rather than component-scoped: both
138
- * are applied via `gogCollapsibleTrigger`/`gogCollapsibleContent` directives to elements a
139
- * *consumer* projects into `<gog-collapsible>` — light DOM that belongs to the consumer's
140
- * own view, not `gog-collapsible`'s, so a scoped stylesheet on the component itself would
141
- * never reach it.
142
- */
143
- .gog-collapsible__trigger {
144
- cursor: pointer;
145
- }
146
-
147
- .gog-collapsible__trigger[aria-disabled='true'] {
148
- cursor: not-allowed;
149
- opacity: var(--gog-collapsible-disabled-opacity);
150
- }
151
-
152
- .gog-collapsible__content {
153
- max-height: 0;
154
- opacity: 0;
155
- overflow: hidden;
156
- transition:
157
- max-height var(--gog-collapsible-transition-duration) var(--gog-easing),
158
- opacity var(--gog-collapsible-transition-duration) var(--gog-easing);
159
- }
160
-
161
- .gog-collapsible__content--open {
162
- max-height: var(--gog-collapsible-max-height);
163
- opacity: 1;
164
- }
165
-
166
- @media (prefers-reduced-motion: reduce) {
167
- .gog-collapsible__content {
168
- transition: none;
169
- }
170
- }
1
+ /*
2
+ * Direction primitives, for the handful of properties CSS gives no logical form of:
3
+ * `transform-origin`, `translate`, `transform`. Everything else uses real logical
4
+ * properties (`inset-inline-start`, `padding-inline-end`, `text-align: start`, …) and needs
5
+ * none of this.
6
+ *
7
+ * --gog-inline-start-side / --gog-inline-end-side `left`/`right` keywords, swapped in RTL.
8
+ * For `transform-origin`.
9
+ * --gog-direction-sign `1` / `-1`. Multiply the X part of a
10
+ * translate by it when the element is
11
+ * placed with `inset-inline-start`.
12
+ *
13
+ * Declared on `:root` and flipped by `[dir='rtl']`, so a subtree can be RTL on its own — an
14
+ * RTL panel inside an LTR page follows the nearest `dir`, like every other RTL behaviour.
15
+ */
16
+ :root {
17
+ --gog-inline-start-side: left;
18
+ --gog-inline-end-side: right;
19
+ --gog-direction-sign: 1;
20
+ }
21
+
22
+ [dir='rtl'] {
23
+ --gog-inline-start-side: right;
24
+ --gog-inline-end-side: left;
25
+ --gog-direction-sign: -1;
26
+ }
27
+
28
+ .gog-inline-center {
29
+ display: inline-flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ }
33
+
34
+ .gog-flex-center {
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ }
39
+
40
+ /*
41
+ * Scopes reflow to this subtree. Never put it on an element that has to paint something
42
+ * outside its own box — `contain: layout` creates a stacking context, so a popup inside
43
+ * it can no longer stack above the rest of the page no matter its z-index. That rules it
44
+ * out for gog-select and gog-multiselect.
45
+ */
46
+ .gog-contained-layout {
47
+ contain: layout style;
48
+ }
49
+
50
+ .gog-cursor-pointer {
51
+ cursor: pointer;
52
+ }
53
+
54
+ .gog-cursor-wait {
55
+ cursor: wait;
56
+ }
57
+
58
+ .gog-cursor-not-allowed {
59
+ cursor: not-allowed;
60
+ }
61
+
62
+ /*
63
+ * Present to assistive tech, invisible on screen. The clip-path/1px recipe rather than
64
+ * `display: none` or `visibility: hidden`, both of which remove the text from the
65
+ * accessibility tree along with the pixels.
66
+ */
67
+ .gog-visually-hidden {
68
+ position: absolute;
69
+ width: 1px;
70
+ height: 1px;
71
+ margin: -1px;
72
+ padding: 0;
73
+ border: 0;
74
+ overflow: hidden;
75
+ clip-path: inset(50%);
76
+ white-space: nowrap;
77
+ }
78
+
79
+ /*
80
+ * `gogBadge`'s classes, global for the same reason as `gog-collapsible`'s below: the
81
+ * directive appends its badge into a *consumer's* element, which is light DOM belonging to
82
+ * that consumer's view, so a scoped stylesheet could never reach it.
83
+ */
84
+ .gog-badge-host {
85
+ /* The badge is positioned against this element, so it has to be a containing block.
86
+ Harmless on an already-relative host; a host that is itself absolutely positioned
87
+ should set its own position after this class, which ordinary specificity allows. */
88
+ position: relative;
89
+ }
90
+
91
+ .gog-badge {
92
+ position: absolute;
93
+ z-index: var(--gog-badge-z);
94
+ display: inline-flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ box-sizing: border-box;
98
+ min-width: var(--gog-badge-size);
99
+ height: var(--gog-badge-size);
100
+ padding-inline: var(--gog-badge-padding-inline);
101
+ border: var(--gog-badge-border-width) var(--gog-badge-border-style) var(--gog-badge-border-color);
102
+ border-radius: var(--gog-badge-radius);
103
+ background-color: var(--gog-badge-bg, var(--gog-badge-variant-bg, var(--gog-badge-danger-bg)));
104
+ color: var(--gog-badge-color, var(--gog-badge-variant-color, var(--gog-badge-danger-color)));
105
+ font-family: var(--gog-badge-font-family);
106
+ font-size: var(--gog-badge-font-size);
107
+ font-weight: var(--gog-badge-font-weight);
108
+ line-height: var(--gog-badge-line-height);
109
+ pointer-events: none;
110
+ white-space: nowrap;
111
+ }
112
+
113
+ /* A dot carries no text, so it collapses to a circle and drops its padding. */
114
+ .gog-badge--dot {
115
+ min-width: var(--gog-badge-dot-size);
116
+ width: var(--gog-badge-dot-size);
117
+ height: var(--gog-badge-dot-size);
118
+ padding-inline: 0;
119
+ border-radius: 50%;
120
+ }
121
+
122
+ /* Logical insets rather than a translate, so the corners follow the writing direction. */
123
+ .gog-badge--top-end {
124
+ top: calc(-1 * var(--gog-badge-offset));
125
+ inset-inline-end: calc(-1 * var(--gog-badge-offset));
126
+ }
127
+
128
+ .gog-badge--top-start {
129
+ top: calc(-1 * var(--gog-badge-offset));
130
+ inset-inline-start: calc(-1 * var(--gog-badge-offset));
131
+ }
132
+
133
+ .gog-badge--bottom-end {
134
+ bottom: calc(-1 * var(--gog-badge-offset));
135
+ inset-inline-end: calc(-1 * var(--gog-badge-offset));
136
+ }
137
+
138
+ .gog-badge--bottom-start {
139
+ bottom: calc(-1 * var(--gog-badge-offset));
140
+ inset-inline-start: calc(-1 * var(--gog-badge-offset));
141
+ }
142
+
143
+ .gog-badge--success {
144
+ --gog-badge-variant-bg: var(--gog-badge-success-bg);
145
+ --gog-badge-variant-color: var(--gog-badge-success-color);
146
+ }
147
+
148
+ .gog-badge--danger {
149
+ --gog-badge-variant-bg: var(--gog-badge-danger-bg);
150
+ --gog-badge-variant-color: var(--gog-badge-danger-color);
151
+ }
152
+
153
+ .gog-badge--warning {
154
+ --gog-badge-variant-bg: var(--gog-badge-warning-bg);
155
+ --gog-badge-variant-color: var(--gog-badge-warning-color);
156
+ }
157
+
158
+ .gog-badge--info {
159
+ --gog-badge-variant-bg: var(--gog-badge-info-bg);
160
+ --gog-badge-variant-color: var(--gog-badge-info-color);
161
+ }
162
+
163
+ /*
164
+ * `gog-collapsible`'s trigger/content classes, global rather than component-scoped: both
165
+ * are applied via `gogCollapsibleTrigger`/`gogCollapsibleContent` directives to elements a
166
+ * *consumer* projects into `<gog-collapsible>` light DOM that belongs to the consumer's
167
+ * own view, not `gog-collapsible`'s, so a scoped stylesheet on the component itself would
168
+ * never reach it.
169
+ */
170
+ .gog-collapsible__trigger {
171
+ cursor: pointer;
172
+ }
173
+
174
+ .gog-collapsible__trigger[aria-disabled='true'] {
175
+ cursor: not-allowed;
176
+ opacity: var(--gog-collapsible-disabled-opacity);
177
+ }
178
+
179
+ .gog-collapsible__content {
180
+ /*
181
+ * Lets the `max-height` transition below run to `max-content` — the default of
182
+ * `--gog-collapsible-max-height` — instead of refusing to animate to an intrinsic keyword.
183
+ * That default is what keeps an open panel from clipping its content at an arbitrary
184
+ * number; this property is only what makes the same value animate.
185
+ *
186
+ * Declared here rather than on `:root`: the property is inherited, and a component library
187
+ * has no business switching keyword interpolation on for a consumer's whole document. It
188
+ * does inherit into this panel's own descendants, which is harmless — it changes nothing
189
+ * for an element that is not animating to or from an intrinsic size.
190
+ *
191
+ * Unsupported browsers ignore it and the panel snaps open, exactly as it does when a
192
+ * consumer sets `--gog-collapsible-max-height: none`.
193
+ */
194
+ interpolate-size: allow-keywords;
195
+ max-height: 0;
196
+ opacity: 0;
197
+ overflow: hidden;
198
+ transition:
199
+ max-height var(--gog-collapsible-transition-duration) var(--gog-easing),
200
+ opacity var(--gog-collapsible-transition-duration) var(--gog-easing);
201
+ }
202
+
203
+ .gog-collapsible__content--open {
204
+ max-height: var(--gog-collapsible-max-height);
205
+ opacity: 1;
206
+ }
207
+
208
+ @media (prefers-reduced-motion: reduce) {
209
+ .gog-collapsible__content {
210
+ transition: none;
211
+ }
212
+ }