@apolitical/component-library 8.3.7 → 8.3.8-ac.1
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.
- package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +4 -1
- package/index.js +44 -44
- package/index.mjs +1363 -1358
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/base/_blockquotes.scss +1 -1
- package/styles/base/_lists.scss +1 -1
- package/styles/base/_table.scss +1 -1
- package/styles/base/_titles.scss +4 -8
- package/styles/base/buttons/_button-wrapper.scss +0 -1
- package/styles/base/buttons/_buttons.scss +5 -10
- package/styles/uclasses/README.md +49 -0
- package/styles/uclasses/uclasses.scss +978 -0
|
@@ -21,7 +21,7 @@ $blockquote: (
|
|
|
21
21
|
@layer base {
|
|
22
22
|
blockquote {
|
|
23
23
|
margin: px-to-rem(get-map($blockquote, 'margin-top')) 0
|
|
24
|
-
px-to-rem(get-map($blockquote, 'margin-bottom'))
|
|
24
|
+
px-to-rem(get-map($blockquote, 'margin-bottom'));
|
|
25
25
|
padding: px-to-rem(get-map($blockquote, 'padding-vertical')) 0 0
|
|
26
26
|
px-to-rem(get-map($blockquote, 'padding-left'));
|
|
27
27
|
font-size: px-to-rem(get-map($blockquote, 'font-size'));
|
package/styles/base/_lists.scss
CHANGED
package/styles/base/_table.scss
CHANGED
|
@@ -13,7 +13,7 @@ $table: (
|
|
|
13
13
|
table {
|
|
14
14
|
width: 100%;
|
|
15
15
|
margin: px-to-rem(get-map($table, 'margin-top')) auto
|
|
16
|
-
px-to-rem(get-map($table, 'margin-bottom'))
|
|
16
|
+
px-to-rem(get-map($table, 'margin-bottom'));
|
|
17
17
|
border-collapse: separate;
|
|
18
18
|
border-spacing: 0;
|
|
19
19
|
display: table;
|
package/styles/base/_titles.scss
CHANGED
|
@@ -186,8 +186,7 @@ $count-icon: (
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
@mixin h2 {
|
|
189
|
-
margin: px-to-rem(get-map($h2, 'margin-top')) 0 px-to-rem(get-map($h2, 'margin-bottom'))
|
|
190
|
-
0;
|
|
189
|
+
margin: px-to-rem(get-map($h2, 'margin-top')) 0 px-to-rem(get-map($h2, 'margin-bottom'));
|
|
191
190
|
font-size: px-to-rem(get-map($h2, 'font-size'));
|
|
192
191
|
color: get-map($theme, 'title');
|
|
193
192
|
text-transform: none;
|
|
@@ -201,8 +200,7 @@ $count-icon: (
|
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
@mixin h3 {
|
|
204
|
-
margin: px-to-rem(get-map($h3, 'margin-top')) 0 px-to-rem(get-map($h3, 'margin-bottom'))
|
|
205
|
-
0;
|
|
203
|
+
margin: px-to-rem(get-map($h3, 'margin-top')) 0 px-to-rem(get-map($h3, 'margin-bottom'));
|
|
206
204
|
font-size: px-to-rem(get-map($h3, 'font-size'));
|
|
207
205
|
color: get-map($theme, 'title');
|
|
208
206
|
text-transform: none;
|
|
@@ -225,8 +223,7 @@ $count-icon: (
|
|
|
225
223
|
}
|
|
226
224
|
|
|
227
225
|
@mixin h4 {
|
|
228
|
-
margin: px-to-rem(get-map($h4, 'margin-top')) 0 px-to-rem(get-map($h4, 'margin-bottom'))
|
|
229
|
-
0;
|
|
226
|
+
margin: px-to-rem(get-map($h4, 'margin-top')) 0 px-to-rem(get-map($h4, 'margin-bottom'));
|
|
230
227
|
font-size: px-to-rem(get-map($h4, 'font-size'));
|
|
231
228
|
color: get-map($theme, 'title');
|
|
232
229
|
text-transform: none;
|
|
@@ -240,8 +237,7 @@ $count-icon: (
|
|
|
240
237
|
}
|
|
241
238
|
|
|
242
239
|
@mixin h5 {
|
|
243
|
-
margin: px-to-rem(get-map($h5, 'margin-top')) 0 px-to-rem(get-map($h5, 'margin-bottom'))
|
|
244
|
-
0;
|
|
240
|
+
margin: px-to-rem(get-map($h5, 'margin-top')) 0 px-to-rem(get-map($h5, 'margin-bottom'));
|
|
245
241
|
font-size: px-to-rem(get-map($h5, 'font-size'));
|
|
246
242
|
color: get-map($theme, 'title');
|
|
247
243
|
text-transform: uppercase;
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
background: get-map($theme, 'button_primary_bg');
|
|
11
11
|
padding: px-to-rem(get-map($button-medium, 'padding-top'))
|
|
12
12
|
px-to-rem(get-map($button-medium, 'padding-horizontal'))
|
|
13
|
-
px-to-rem(get-map($button-medium, 'padding-bottom'))
|
|
14
|
-
px-to-rem(get-map($button-medium, 'padding-horizontal'));
|
|
13
|
+
px-to-rem(get-map($button-medium, 'padding-bottom'));
|
|
15
14
|
position: relative;
|
|
16
15
|
text-align: center;
|
|
17
16
|
font-size: px-to-rem(get-map($button-medium, 'font-size'));
|
|
@@ -50,8 +49,7 @@
|
|
|
50
49
|
background: get-map($theme, 'button_new_primary_bg');
|
|
51
50
|
padding: px-to-rem(get-map($button-medium, 'padding-top_new'))
|
|
52
51
|
px-to-rem(get-map($button-medium, 'padding-horizontal_new'))
|
|
53
|
-
px-to-rem(get-map($button-medium, 'padding-bottom_new'))
|
|
54
|
-
px-to-rem(get-map($button-medium, 'padding-horizontal_new'));
|
|
52
|
+
px-to-rem(get-map($button-medium, 'padding-bottom_new'));
|
|
55
53
|
color: get-map($theme, 'button_primary');
|
|
56
54
|
|
|
57
55
|
&:hover,
|
|
@@ -66,16 +64,14 @@
|
|
|
66
64
|
&.#{$size} {
|
|
67
65
|
padding: px-to-rem(get-map($styles, 'padding-top'))
|
|
68
66
|
px-to-rem(get-map($styles, 'padding-horizontal'))
|
|
69
|
-
px-to-rem(get-map($styles, 'padding-bottom'))
|
|
70
|
-
px-to-rem(get-map($styles, 'padding-horizontal'));
|
|
67
|
+
px-to-rem(get-map($styles, 'padding-bottom'));
|
|
71
68
|
font-size: px-to-rem(get-map($styles, 'font-size'));
|
|
72
69
|
|
|
73
70
|
// TODO: remove `new` styling when we switch to new styling everywhere
|
|
74
71
|
&.new {
|
|
75
72
|
padding: px-to-rem(get-map($styles, 'padding-top_new'))
|
|
76
73
|
px-to-rem(get-map($styles, 'padding-horizontal_new'))
|
|
77
|
-
px-to-rem(get-map($styles, 'padding-bottom_new'))
|
|
78
|
-
px-to-rem(get-map($styles, 'padding-horizontal_new'));
|
|
74
|
+
px-to-rem(get-map($styles, 'padding-bottom_new'));
|
|
79
75
|
}
|
|
80
76
|
|
|
81
77
|
&.icon {
|
|
@@ -214,8 +210,7 @@
|
|
|
214
210
|
&:not(.new) {
|
|
215
211
|
padding: px-to-rem(get-map($tertiary, 'padding-top'))
|
|
216
212
|
px-to-rem(get-map($tertiary, 'padding-horizontal'))
|
|
217
|
-
px-to-rem(get-map($tertiary, 'padding-bottom'))
|
|
218
|
-
px-to-rem(get-map($tertiary, 'padding-horizontal'));
|
|
213
|
+
px-to-rem(get-map($tertiary, 'padding-bottom'));
|
|
219
214
|
bottom: px-to-rem(get-map($tertiary, 'padding-top'));
|
|
220
215
|
right: px-to-rem(get-map($tertiary, 'padding-horizontal'));
|
|
221
216
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Utility Classes
|
|
2
|
+
|
|
3
|
+
These are utility classes that are used in the `next-ui` app and libraries. They are deliberately simple in order to test the adoption within the team.
|
|
4
|
+
|
|
5
|
+
The starting point for the tooling to generate these classes came from [codyframe](https://github.com/codyhouse/codyframe).
|
|
6
|
+
In future we may want to expand on our small set using more of the utility classes that codyframe has, or even use something like [tailwindcss](https://tailwindcss.com/) instead.
|
|
7
|
+
|
|
8
|
+
The `global.css` file is used to define the utility classes globally and also for intellisense in the editor. If you modify the generator sass then you will need to run `pnpm build:uclasses` from the root of the `/frontend/v2` workspace.
|
|
9
|
+
|
|
10
|
+
Ensure you have the recommended extension from .vscode workspace settings to get the intellisense.
|
|
11
|
+
|
|
12
|
+
## Available Classes
|
|
13
|
+
|
|
14
|
+
### Layout & Display
|
|
15
|
+
|
|
16
|
+
- **Flex**: `.flex`, `.inline-flex`, `.flex-wrap`, `.flex-nowrap`, `.flex-col`, `.flex-col-reverse`, `.flex-row`, `.flex-row-reverse`, `.flex-center`, `.flex-grow`, `.flex-grow-0`, `.flex-shrink`, `.flex-shrink-0`, `.flex-basis-0`
|
|
17
|
+
- **Alignment**: `.justify-[start|end|center|between]`, `.items-[center|start|end|baseline|stretch]`, `.content-[start|end|center|between]`
|
|
18
|
+
- **Display**: `.block`, `.inline-block`, `.inline`, `.contents`, `.grid`, `.inline-grid`, `.hidden`
|
|
19
|
+
- **Gap**: `.gap-[0|px|0.5|1|1.5|2|2.5|3|3.5|4|5|6|7|8|9|10|11|12|14|16|20|24|28|32|36|40|44|48|52|56|60|64|72]`, `.gap-[x|y]-[sizes]`
|
|
20
|
+
|
|
21
|
+
### Spacing & Position
|
|
22
|
+
|
|
23
|
+
- **Margin**: `.m-[auto|0]`, `.m[x|y]-[auto|0]`, `.m[t|r|b|l]-[auto|0]`
|
|
24
|
+
- **Padding**: `.p[x|y]-0`, `.p[t|r|b|l]-0`
|
|
25
|
+
- **Position**: `.relative`, `.absolute`, `.fixed`, `.sticky`, `.static`, `.inset-0`
|
|
26
|
+
- **Z-Index**: `.z-[0|1|2|3]`
|
|
27
|
+
- **Width**: `.w-full`
|
|
28
|
+
- **Max Width**: `.max-w-[0|px|0.5...72|none|xs|sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|full|min|max|fit|prose|screen-sm|screen-md|screen-lg|screen-xl|screen-2xl]`
|
|
29
|
+
|
|
30
|
+
### Typography
|
|
31
|
+
|
|
32
|
+
- **Text**: `.truncate`/`.text-truncate`, `.text-replace`, `.break-word`
|
|
33
|
+
- **Transform**: `.uppercase`, `.capitalize`
|
|
34
|
+
- **Alignment**: `.text-[center|left|right|justify]`
|
|
35
|
+
- **Decoration**: `.line-through`, `.underline`, `.text-decoration-none`
|
|
36
|
+
- **Vertical Align**: `.align-[baseline|sub|super|text-top|text-bottom|top|middle|bottom]`
|
|
37
|
+
|
|
38
|
+
### Other Utilities
|
|
39
|
+
|
|
40
|
+
- **Cursor**: `.cursor-[pointer|default]`
|
|
41
|
+
- **Events**: `.pointer-events-[auto|none]`
|
|
42
|
+
- **Height**: `.min-h-[0|full|screen]`, `.max-h-[full|screen]`
|
|
43
|
+
- **Opacity**: `.opacity-[0|25|50|75|100]`
|
|
44
|
+
- **Overflow**: `.overflow-[visible|hidden|clip|auto]`, `.overflow-[x|y]-[hidden|clip]`
|
|
45
|
+
- **Scroll**: `.momentum-scrolling`, `.overscroll-contain`, `.scroll-smooth`
|
|
46
|
+
- **Object Fit**: `.object-[contain|cover]`
|
|
47
|
+
- **Transform**: `.rotate-[90|180|270]`
|
|
48
|
+
- **Transform Origin**: `.origin-[center|top|right|bottom|left|top-left|top-right|bottom-left|bottom-right]`
|
|
49
|
+
- **Visibility**: `.visible`, `.invisible`
|