@kth/style 1.12.0-alpha.0 → 1.12.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/README.md +1 -3
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -18
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +1 -18
- package/package.json +1 -1
- package/scss/components/tabs.scss +51 -0
- package/dist/cjs/accordion.js +0 -2
- package/dist/cjs/components/Accordion.d.ts +0 -4
- package/dist/esm/accordion.js +0 -1
- package/dist/esm/components/Accordion.d.ts +0 -4
package/README.md
CHANGED
|
@@ -10,8 +10,7 @@ Documentation available in the [KTH Style website](https://kthstyledemoprod.z6.w
|
|
|
10
10
|
@kth/style
|
|
11
11
|
├── src/
|
|
12
12
|
│ ├── index.ts
|
|
13
|
-
│
|
|
14
|
-
│ └── react-components
|
|
13
|
+
│ └── components
|
|
15
14
|
├── scss/
|
|
16
15
|
│ ├── components
|
|
17
16
|
│ ├── tokens
|
|
@@ -25,6 +24,5 @@ Documentation available in the [KTH Style website](https://kthstyledemoprod.z6.w
|
|
|
25
24
|
- `scss` contains all CSS. Those can be imported as they are
|
|
26
25
|
- `src` contains source for JavaScript components. Written in JavaScript
|
|
27
26
|
- `src/components` are the components that do not use React
|
|
28
|
-
- `src/react-components` are the React components
|
|
29
27
|
- `index.ts` and `react.ts` re-export the content in the respective `components` directories
|
|
30
28
|
- `assets` are static assets like the fonts and logotype. This is meant to be exposed by apps using KTH Style
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -124,22 +124,4 @@ class MenuPanel {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* Toggles accordion summary title depending on open or close state.
|
|
129
|
-
*/
|
|
130
|
-
function toggleSummaryTitle() {
|
|
131
|
-
const detailsElements = document.querySelectorAll("details");
|
|
132
|
-
detailsElements.forEach((detailsElement) => {
|
|
133
|
-
const summaryTitle = detailsElement.querySelector("summary");
|
|
134
|
-
if (summaryTitle) {
|
|
135
|
-
detailsElement.addEventListener("toggle", () => {
|
|
136
|
-
summaryTitle.textContent = detailsElement.open
|
|
137
|
-
? "Hide content"
|
|
138
|
-
: "Show content";
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
127
|
exports.MenuPanel = MenuPanel;
|
|
145
|
-
exports.toggleSummaryTitle = toggleSummaryTitle;
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -122,21 +122,4 @@ class MenuPanel {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
* Toggles accordion summary title depending on open or close state.
|
|
127
|
-
*/
|
|
128
|
-
function toggleSummaryTitle() {
|
|
129
|
-
const detailsElements = document.querySelectorAll("details");
|
|
130
|
-
detailsElements.forEach((detailsElement) => {
|
|
131
|
-
const summaryTitle = detailsElement.querySelector("summary");
|
|
132
|
-
if (summaryTitle) {
|
|
133
|
-
detailsElement.addEventListener("toggle", () => {
|
|
134
|
-
summaryTitle.textContent = detailsElement.open
|
|
135
|
-
? "Hide content"
|
|
136
|
-
: "Show content";
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export { MenuPanel, toggleSummaryTitle };
|
|
125
|
+
export { MenuPanel };
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use "../tokens/spacing";
|
|
2
|
+
@use "../tokens/icons";
|
|
3
|
+
@use "../tokens/colors";
|
|
4
|
+
@use "../utils/mixins";
|
|
5
|
+
|
|
6
|
+
@layer kth-style {
|
|
7
|
+
.kth-tabs {
|
|
8
|
+
margin-block: spacing.$space-2;
|
|
9
|
+
padding-block: spacing.$space-4;
|
|
10
|
+
border-bottom: 1px solid var(--color-border);
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
ul {
|
|
14
|
+
list-style: none;
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
gap: spacing.$space-20;
|
|
18
|
+
|
|
19
|
+
@include mixins.horizontal-list;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__item {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
color: var(--color-primary);
|
|
26
|
+
padding: 0;
|
|
27
|
+
gap: spacing.$space-4;
|
|
28
|
+
|
|
29
|
+
// Fixes for buttons:
|
|
30
|
+
border: none;
|
|
31
|
+
background: none;
|
|
32
|
+
|
|
33
|
+
&:hover,
|
|
34
|
+
&.active {
|
|
35
|
+
text-decoration: underline;
|
|
36
|
+
text-underline-offset: spacing.$space-8;
|
|
37
|
+
text-decoration-thickness: spacing.$space-4;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.kth-tabs__pane {
|
|
44
|
+
margin-block: spacing.$space-4;
|
|
45
|
+
padding: spacing.$space-4;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.hidden {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
package/dist/cjs/accordion.js
DELETED
package/dist/esm/accordion.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|