@stackoverflow/stacks 0.73.1 → 0.76.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.
Files changed (87) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +47 -47
  3. package/dist/controllers/index.d.ts +7 -0
  4. package/dist/controllers/s-expandable-control.d.ts +17 -0
  5. package/dist/controllers/s-modal.d.ts +97 -0
  6. package/dist/controllers/s-navigation-tablist.d.ts +36 -0
  7. package/dist/controllers/s-popover.d.ts +155 -0
  8. package/dist/controllers/s-table.d.ts +8 -0
  9. package/dist/controllers/s-tooltip.d.ts +82 -0
  10. package/dist/controllers/s-uploader.d.ts +48 -0
  11. package/dist/css/stacks.css +441 -141
  12. package/dist/css/stacks.min.css +1 -1
  13. package/dist/index.d.ts +3 -0
  14. package/dist/js/stacks.js +6130 -5488
  15. package/dist/js/stacks.min.js +1 -1
  16. package/dist/stacks.d.ts +21 -0
  17. package/lib/css/atomic/_stacks-borders.less +378 -378
  18. package/lib/css/atomic/_stacks-colors.less +209 -209
  19. package/lib/css/atomic/_stacks-flex.less +374 -374
  20. package/lib/css/atomic/_stacks-grid.less +174 -173
  21. package/lib/css/atomic/_stacks-misc.less +343 -342
  22. package/lib/css/atomic/_stacks-spacing.less +168 -162
  23. package/lib/css/atomic/_stacks-typography.less +273 -270
  24. package/lib/css/atomic/_stacks-width-height.less +195 -189
  25. package/lib/css/base/_stacks-body.less +44 -46
  26. package/lib/css/base/_stacks-configuration-static.less +59 -59
  27. package/lib/css/base/_stacks-icons.less +20 -20
  28. package/lib/css/base/_stacks-internals.less +220 -230
  29. package/lib/css/base/_stacks-reset-meyer.less +64 -64
  30. package/lib/css/base/_stacks-reset-normalize.less +449 -449
  31. package/lib/css/base/_stacks-reset.less +20 -20
  32. package/lib/css/components/_stacks-activity-indicator.less +45 -45
  33. package/lib/css/components/_stacks-avatars.less +189 -189
  34. package/lib/css/components/_stacks-badges.less +209 -209
  35. package/lib/css/components/_stacks-banners.less +80 -81
  36. package/lib/css/components/_stacks-blank-states.less +26 -26
  37. package/lib/css/components/_stacks-breadcrumbs.less +44 -44
  38. package/lib/css/components/_stacks-button-groups.less +104 -104
  39. package/lib/css/components/_stacks-buttons.less +658 -660
  40. package/lib/css/components/_stacks-cards.less +44 -44
  41. package/lib/css/components/_stacks-code-blocks.less +130 -130
  42. package/lib/css/components/_stacks-collapsible.less +104 -104
  43. package/lib/css/components/_stacks-inputs.less +728 -724
  44. package/lib/css/components/_stacks-link-previews.less +136 -136
  45. package/lib/css/components/_stacks-links.less +218 -218
  46. package/lib/css/components/_stacks-menu.less +47 -47
  47. package/lib/css/components/_stacks-modals.less +133 -133
  48. package/lib/css/components/_stacks-navigation.less +146 -146
  49. package/lib/css/components/_stacks-notices.less +233 -233
  50. package/lib/css/components/_stacks-page-titles.less +60 -60
  51. package/lib/css/components/_stacks-pagination.less +55 -55
  52. package/lib/css/components/_stacks-popovers.less +197 -197
  53. package/lib/css/components/_stacks-post-summary.less +425 -311
  54. package/lib/css/components/_stacks-progress-bars.less +331 -331
  55. package/lib/css/components/_stacks-prose.less +503 -503
  56. package/lib/css/components/_stacks-spinner.less +107 -107
  57. package/lib/css/components/_stacks-tables.less +341 -341
  58. package/lib/css/components/_stacks-tags.less +237 -209
  59. package/lib/css/components/_stacks-toggle-switches.less +144 -137
  60. package/lib/css/components/_stacks-topbar.less +425 -440
  61. package/lib/css/components/_stacks-uploader.less +210 -210
  62. package/lib/css/components/_stacks-user-cards.less +169 -193
  63. package/lib/css/components/_stacks-widget-dynamic.less +33 -33
  64. package/lib/css/components/_stacks-widget-static.less +272 -272
  65. package/lib/css/exports/_stacks-constants-colors.less +1112 -1098
  66. package/lib/css/exports/_stacks-constants-helpers.less +139 -139
  67. package/lib/css/exports/_stacks-constants-type.less +152 -91
  68. package/lib/css/exports/_stacks-exports.less +15 -15
  69. package/lib/css/exports/_stacks-mixins.less +220 -220
  70. package/lib/css/stacks-dynamic.less +35 -36
  71. package/lib/css/stacks-static.less +86 -86
  72. package/lib/ts/controllers/index.ts +8 -0
  73. package/lib/ts/controllers/s-expandable-control.ts +189 -190
  74. package/lib/ts/controllers/s-modal.ts +321 -323
  75. package/lib/ts/controllers/s-navigation-tablist.ts +118 -119
  76. package/lib/ts/controllers/s-popover.ts +547 -549
  77. package/lib/ts/controllers/s-table.ts +220 -220
  78. package/lib/ts/controllers/s-tooltip.ts +246 -247
  79. package/lib/ts/controllers/s-uploader.ts +172 -174
  80. package/lib/ts/index.ts +20 -0
  81. package/lib/ts/stacks.ts +88 -83
  82. package/lib/tsconfig.json +13 -11
  83. package/package.json +87 -71
  84. package/dist/css/stacks-flexgrid-shim.min.css +0 -1
  85. package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
  86. package/lib/ts/finalize.ts +0 -1
  87. package/lib/ts/stimulus.d.ts +0 -4
@@ -1,133 +1,133 @@
1
- //
2
- // STACK OVERFLOW
3
- // MODALS
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // TABLE OF CONTENTS
10
- // • BASE STYLE
11
- // • LAYOUT TRANSITIONS
12
- //
13
- // ============================================================================
14
- // $ BASE STYLE
15
- // ----------------------------------------------------------------------------
16
- .s-modal {
17
- display: flex;
18
- visibility: hidden;
19
- position: fixed;
20
- z-index: @zi-hide; // Make sure it's also below everything so we can't interact with it.
21
-
22
- // This fills the entire viewport without having to worry about size.
23
- top: 0;
24
- right: 0;
25
- bottom: 0;
26
- left: 0;
27
- align-items: center;
28
- justify-content: center;
29
- background-color: fade(@black-900, 50%); // Background remains fixed
30
- opacity: 0;
31
- backface-visibility: hidden;
32
- transition: opacity 100ms @te-smooth 0s, z-index 0s 100ms, visibility 0s 100ms; // Transition out
33
- will-change: visibility, z-index, opacity; // Not supported in Edge
34
-
35
- &[aria-hidden="false"],
36
- &[aria-hidden="false"] .s-modal--dialog {
37
- visibility: visible;
38
- z-index: @zi-modals;
39
- opacity: 1;
40
- transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
41
- transition: opacity 100ms @te-smooth 10ms, z-index 0s 0s, visibility 0s 0s, transform 100ms @te-smooth 10ms, transform 100ms @te-smooth 10ms; // Transition in
42
- }
43
- }
44
-
45
- .s-modal--dialog {
46
- overflow-y: auto;
47
- visibility: hidden;
48
- z-index: @zi-hide; // Make sure it's also below everything so we can't interact with it.
49
- max-width: 600px;
50
- max-height: 100%;
51
- padding: @su24;
52
- border-radius: @br-lg;
53
- background-color: var(--white);
54
- box-shadow: var(--bs-lg);
55
- opacity: 0;
56
- backface-visibility: hidden;
57
- transform: translate3d(0, 30%, 0) scale3d(0.6, 0.6, 0.6);
58
-
59
- .dark-mode({
60
- background-color: var(--black-100);
61
- });
62
-
63
- @scrollbar-styles();
64
-
65
- transition: opacity 200ms @te-smooth 0s, z-index 0s 100ms, visibility 0s 100ms, transform 100ms @te-smooth 0s, transform 100ms @te-smooth 0s; // Transition out
66
- will-change: visibility, z-index, opacity, transform; // Not supported by Edge
67
-
68
- .s-modal[aria-hidden="false"] & {
69
- transform: translate3d(0, 0, 0) scale3d(1, 1, 1); // Transition in
70
- }
71
- }
72
-
73
- // [1] To override .s-btn class attributes
74
- .s-modal--close {
75
- position: absolute !important; // [1]
76
- top: @su8;
77
- right: @su8;
78
- padding: @su12 !important; // [1]
79
-
80
- .svg-icon {
81
- margin: 0 !important;
82
- }
83
- }
84
-
85
- // ============================================================================
86
- // $ DIALOG PIECES
87
- // ----------------------------------------------------------------------------
88
- .s-modal--header {
89
- margin-bottom: @su16;
90
- color: var(--fc-dark);
91
- font-size: @fs-headline1;
92
- font-weight: normal;
93
- line-height: @lh-sm;
94
- }
95
-
96
- .s-modal--body {
97
- margin-bottom: @su24;
98
- color: var(--fc-medium);
99
- }
100
-
101
- .s-modal--footer {
102
- margin-top: @su24;
103
- }
104
-
105
-
106
- // ============================================================================
107
- // $ STATES
108
- // ----------------------------------------------------------------------------
109
- .s-modal.has-danger,
110
- .s-modal.s-modal__danger {
111
- background-color: darken(fade(@red-900, 50%), 23%);
112
-
113
- .s-modal--header {
114
- color: var(--red-600);
115
- }
116
- }
117
-
118
- .s-modal.s-modal__celebration .s-modal--dialog {
119
- padding-top: @su64;
120
- .bg-confetti-animated;
121
-
122
- .s-modal--close {
123
- top: @su48;
124
- }
125
- }
126
-
127
- // ============================================================================
128
- // $ SIZES
129
- // ----------------------------------------------------------------------------
130
- .s-modal__full {
131
- max-width: calc(~"100% - @{su48}");
132
- max-height: calc(~"100% - @{su48}");
133
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // MODALS
4
+ //
5
+ // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
+ // Stack Overflow. For documentation of all these classes and how to contribute,
7
+ // visit https://stackoverflow.design/
8
+ //
9
+ // TABLE OF CONTENTS
10
+ // • BASE STYLE
11
+ // • LAYOUT TRANSITIONS
12
+ //
13
+ // ============================================================================
14
+ // $ BASE STYLE
15
+ // ----------------------------------------------------------------------------
16
+ .s-modal {
17
+ display: flex;
18
+ visibility: hidden;
19
+ position: fixed;
20
+ z-index: @zi-hide; // Make sure it's also below everything so we can't interact with it.
21
+
22
+ // This fills the entire viewport without having to worry about size.
23
+ top: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ left: 0;
27
+ align-items: center;
28
+ justify-content: center;
29
+ background-color: fade(@black-900, 50%); // Background remains fixed
30
+ opacity: 0;
31
+ backface-visibility: hidden;
32
+ transition: opacity 100ms @te-smooth 0s, z-index 0s 100ms, visibility 0s 100ms; // Transition out
33
+ will-change: visibility, z-index, opacity; // Not supported in Edge
34
+
35
+ &[aria-hidden="false"],
36
+ &[aria-hidden="false"] .s-modal--dialog {
37
+ visibility: visible;
38
+ z-index: @zi-modals;
39
+ opacity: 1;
40
+ transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
41
+ transition: opacity 100ms @te-smooth 10ms, z-index 0s 0s, visibility 0s 0s, transform 100ms @te-smooth 10ms, transform 100ms @te-smooth 10ms; // Transition in
42
+ }
43
+ }
44
+
45
+ .s-modal--dialog {
46
+ overflow-y: auto;
47
+ visibility: hidden;
48
+ z-index: @zi-hide; // Make sure it's also below everything so we can't interact with it.
49
+ max-width: 600px;
50
+ max-height: 100%;
51
+ padding: @su24;
52
+ border-radius: @br-lg;
53
+ background-color: var(--white);
54
+ box-shadow: var(--bs-lg);
55
+ opacity: 0;
56
+ backface-visibility: hidden;
57
+ transform: translate3d(0, 30%, 0) scale3d(0.6, 0.6, 0.6);
58
+
59
+ .dark-mode({
60
+ background-color: var(--black-100);
61
+ });
62
+
63
+ @scrollbar-styles();
64
+
65
+ transition: opacity 200ms @te-smooth 0s, z-index 0s 100ms, visibility 0s 100ms, transform 100ms @te-smooth 0s, transform 100ms @te-smooth 0s; // Transition out
66
+ will-change: visibility, z-index, opacity, transform; // Not supported by Edge
67
+
68
+ .s-modal[aria-hidden="false"] & {
69
+ transform: translate3d(0, 0, 0) scale3d(1, 1, 1); // Transition in
70
+ }
71
+ }
72
+
73
+ // [1] To override .s-btn class attributes
74
+ .s-modal--close {
75
+ position: absolute !important; // [1]
76
+ top: @su8;
77
+ right: @su8;
78
+ padding: @su12 !important; // [1]
79
+
80
+ .svg-icon {
81
+ margin: 0 !important;
82
+ }
83
+ }
84
+
85
+ // ============================================================================
86
+ // $ DIALOG PIECES
87
+ // ----------------------------------------------------------------------------
88
+ .s-modal--header {
89
+ margin-bottom: @su16;
90
+ color: var(--fc-dark);
91
+ font-size: @fs-headline1;
92
+ font-weight: normal;
93
+ line-height: @lh-sm;
94
+ }
95
+
96
+ .s-modal--body {
97
+ margin-bottom: @su24;
98
+ color: var(--fc-medium);
99
+ }
100
+
101
+ .s-modal--footer {
102
+ margin-top: @su24;
103
+ }
104
+
105
+
106
+ // ============================================================================
107
+ // $ STATES
108
+ // ----------------------------------------------------------------------------
109
+ .s-modal.has-danger,
110
+ .s-modal.s-modal__danger {
111
+ background-color: darken(fade(@red-900, 50%), 23%);
112
+
113
+ .s-modal--header {
114
+ color: var(--red-600);
115
+ }
116
+ }
117
+
118
+ .s-modal.s-modal__celebration .s-modal--dialog {
119
+ padding-top: @su64;
120
+ .bg-confetti-animated;
121
+
122
+ .s-modal--close {
123
+ top: @su48;
124
+ }
125
+ }
126
+
127
+ // ============================================================================
128
+ // $ SIZES
129
+ // ----------------------------------------------------------------------------
130
+ .s-modal__full {
131
+ max-width: calc(~"100% - @{su48}");
132
+ max-height: calc(~"100% - @{su48}");
133
+ }
@@ -1,146 +1,146 @@
1
- //
2
- // STACK OVERFLOW
3
- // NAVIGATION
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // TABLE OF CONTENTS
10
- // • BASE STYLE
11
- // • MUTED STYLE
12
- //
13
- // ============================================================================
14
- // $ BASE STYLE
15
- // ----------------------------------------------------------------------------
16
- .s-navigation {
17
- display: flex;
18
- margin: -@su2;
19
- padding: @su2 0;
20
- flex-wrap: wrap;
21
-
22
- // If the s-navigation is a list, let's reset all the properties
23
- list-style: none;
24
-
25
- .s-navigation--item {
26
- display: flex;
27
- align-items: center;
28
- padding: @su6 @su12;
29
- position: relative;
30
-
31
- // Reset some things for when the navigation item is also a button
32
- border: none;
33
- font: unset;
34
- background: none;
35
- box-shadow: none;
36
- cursor: pointer;
37
- user-select: auto;
38
- border-radius: 1000px;
39
- margin: @su2;
40
- white-space: nowrap;
41
- color: var(--black-600);
42
-
43
- &:hover,
44
- &:active {
45
- background: var(--black-075);
46
- color: var(--black-600);
47
-
48
- .highcontrast-mode({
49
- background: var(--black-600);
50
- color: var(--black-100);
51
- });
52
- }
53
-
54
- @focus-styles();
55
-
56
- &.is-selected {
57
- background: var(--theme-primary-color);
58
- color: var(--white);
59
-
60
- &:hover,
61
- &:active {
62
- background: var(--theme-primary-600);
63
- color: var(--white);
64
- }
65
-
66
- .highcontrast-mode({ text-decoration: none; });
67
- }
68
-
69
- &.s-navigation--item__dropdown {
70
- padding-right: 2em;
71
-
72
- &:after {
73
- content: "";
74
- position: absolute;
75
- z-index: @zi-active;
76
- top: calc(50% - 2px);
77
- right: 0.9em;
78
- border-style: solid;
79
- border-width: @su4;
80
- border-top-width: @su4;
81
- border-bottom-width: 0;
82
- border-color: currentColor transparent;
83
- pointer-events: none;
84
- }
85
- }
86
- }
87
-
88
- &.s-navigation__scroll {
89
- overflow-x: auto;
90
- flex-wrap: nowrap;
91
-
92
- @scrollbar-styles();
93
- }
94
-
95
- &.s-navigation__vertical {
96
- flex-direction: column;
97
- padding: 0;
98
- margin: 0;
99
-
100
- .s-navigation--item {
101
- margin: 0;
102
- white-space: normal;
103
- }
104
- }
105
-
106
- .s-navigation--title {
107
- font-size: @fs-fine;
108
- font-weight: bold;
109
- margin-top: @su16;
110
- padding: @su6 @su12;
111
- text-transform: uppercase;
112
-
113
- &:first-child {
114
- margin-top: 0;
115
- }
116
- }
117
-
118
- // ============================================================================
119
- // $ MUTED STYLE
120
- // ----------------------------------------------------------------------------
121
- &.s-navigation__muted .s-navigation--item {
122
- &.is-selected {
123
- background: var(--black-050);
124
- color: var(--black-800);
125
-
126
- .highcontrast-mode({
127
- background: var(--black-800);
128
- color: var(--black-050);
129
- });
130
- }
131
- }
132
-
133
- // ============================================================================
134
- // $ SMALL SIZE
135
- // ----------------------------------------------------------------------------
136
- &.s-navigation__sm {
137
- .s-navigation--item {
138
- padding: @su4 @su12;
139
- font-size: @fs-caption;
140
-
141
- &.s-navigation--item__dropdown {
142
- padding-right: 2em;
143
- }
144
- }
145
- }
146
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // NAVIGATION
4
+ //
5
+ // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
+ // Stack Overflow. For documentation of all these classes and how to contribute,
7
+ // visit https://stackoverflow.design/
8
+ //
9
+ // TABLE OF CONTENTS
10
+ // • BASE STYLE
11
+ // • MUTED STYLE
12
+ //
13
+ // ============================================================================
14
+ // $ BASE STYLE
15
+ // ----------------------------------------------------------------------------
16
+ .s-navigation {
17
+ display: flex;
18
+ margin: -@su2;
19
+ padding: @su2 0;
20
+ flex-wrap: wrap;
21
+
22
+ // If the s-navigation is a list, let's reset all the properties
23
+ list-style: none;
24
+
25
+ .s-navigation--item {
26
+ display: flex;
27
+ align-items: center;
28
+ padding: @su6 @su12;
29
+ position: relative;
30
+
31
+ // Reset some things for when the navigation item is also a button
32
+ border: none;
33
+ font: unset;
34
+ background: none;
35
+ box-shadow: none;
36
+ cursor: pointer;
37
+ user-select: auto;
38
+ border-radius: 1000px;
39
+ margin: @su2;
40
+ white-space: nowrap;
41
+ color: var(--black-600);
42
+
43
+ &:hover,
44
+ &:active {
45
+ background: var(--black-075);
46
+ color: var(--black-600);
47
+
48
+ .highcontrast-mode({
49
+ background: var(--black-600);
50
+ color: var(--black-100);
51
+ });
52
+ }
53
+
54
+ @focus-styles();
55
+
56
+ &.is-selected {
57
+ background: var(--theme-primary-color);
58
+ color: var(--white);
59
+
60
+ &:hover,
61
+ &:active {
62
+ background: var(--theme-primary-600);
63
+ color: var(--white);
64
+ }
65
+
66
+ .highcontrast-mode({ text-decoration: none; });
67
+ }
68
+
69
+ &.s-navigation--item__dropdown {
70
+ padding-right: 2em;
71
+
72
+ &:after {
73
+ content: "";
74
+ position: absolute;
75
+ z-index: @zi-active;
76
+ top: calc(50% - 2px);
77
+ right: 0.9em;
78
+ border-style: solid;
79
+ border-width: @su4;
80
+ border-top-width: @su4;
81
+ border-bottom-width: 0;
82
+ border-color: currentColor transparent;
83
+ pointer-events: none;
84
+ }
85
+ }
86
+ }
87
+
88
+ &.s-navigation__scroll {
89
+ overflow-x: auto;
90
+ flex-wrap: nowrap;
91
+
92
+ @scrollbar-styles();
93
+ }
94
+
95
+ &.s-navigation__vertical {
96
+ flex-direction: column;
97
+ padding: 0;
98
+ margin: 0;
99
+
100
+ .s-navigation--item {
101
+ margin: 0;
102
+ white-space: normal;
103
+ }
104
+ }
105
+
106
+ .s-navigation--title {
107
+ font-size: @fs-fine;
108
+ font-weight: bold;
109
+ margin-top: @su16;
110
+ padding: @su6 @su12;
111
+ text-transform: uppercase;
112
+
113
+ &:first-child {
114
+ margin-top: 0;
115
+ }
116
+ }
117
+
118
+ // ============================================================================
119
+ // $ MUTED STYLE
120
+ // ----------------------------------------------------------------------------
121
+ &.s-navigation__muted .s-navigation--item {
122
+ &.is-selected {
123
+ background: var(--black-050);
124
+ color: var(--black-800);
125
+
126
+ .highcontrast-mode({
127
+ background: var(--black-800);
128
+ color: var(--black-050);
129
+ });
130
+ }
131
+ }
132
+
133
+ // ============================================================================
134
+ // $ SMALL SIZE
135
+ // ----------------------------------------------------------------------------
136
+ &.s-navigation__sm {
137
+ .s-navigation--item {
138
+ padding: @su4 @su12;
139
+ font-size: @fs-caption;
140
+
141
+ &.s-navigation--item__dropdown {
142
+ padding-right: 2em;
143
+ }
144
+ }
145
+ }
146
+ }