@canonical/react-ds-app-launchpad 0.37.0 → 0.38.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.
- package/README.md +54 -0
- package/dist/esm/lib/DiffChangeMarker/common/DetailedChangeMarker/styles.css +19 -15
- package/dist/esm/lib/DiffChangeMarker/common/SimpleChangeMarker/styles.css +25 -22
- package/dist/esm/lib/DiffChangeMarker/styles.css +24 -21
- package/dist/esm/lib/EditableBlock/styles.css +33 -29
- package/dist/esm/lib/FileTree/common/File/styles.css +8 -4
- package/dist/esm/lib/FileTree/common/Folder/styles.css +8 -4
- package/dist/esm/lib/FileTree/common/IndentationBlock/styles.css +29 -26
- package/dist/esm/lib/FileTree/common/Node/styles.css +50 -46
- package/dist/esm/lib/FileTree/common/SearchBox/styles.css +54 -51
- package/dist/esm/lib/FileTree/styles.css +46 -43
- package/dist/esm/lib/GitDiffViewer/common/CodeDiffViewer/HighlighTheme.css +174 -170
- package/dist/esm/lib/GitDiffViewer/common/CodeDiffViewer/common/AnnotatedDiffLine/styles.css +15 -12
- package/dist/esm/lib/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/styles.css +92 -89
- package/dist/esm/lib/GitDiffViewer/common/CodeDiffViewer/styles.css +22 -19
- package/dist/esm/lib/GitDiffViewer/common/FileHeader/styles.css +41 -38
- package/dist/esm/lib/GitDiffViewer/styles.css +24 -20
- package/dist/esm/lib/MarkdownEditor/common/Toolbar/common/Button/styles.css +16 -13
- package/dist/esm/lib/MarkdownEditor/common/Toolbar/common/Group/styles.css +8 -5
- package/dist/esm/lib/MarkdownEditor/common/Toolbar/common/Separator/styles.css +8 -5
- package/dist/esm/lib/MarkdownEditor/common/Toolbar/styles.css +14 -11
- package/dist/esm/lib/MarkdownEditor/common/ViewModeTabs/styles.css +36 -33
- package/dist/esm/lib/MarkdownEditor/styles.css +68 -64
- package/dist/esm/lib/index.css +43 -0
- package/dist/types/lib/FileTree/types.d.ts +1 -1
- package/dist/types/lib/FileTree/types.d.ts.map +1 -1
- package/dist/types/lib/GitDiffViewer/types.d.ts +1 -1
- package/dist/types/lib/GitDiffViewer/types.d.ts.map +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -14,6 +14,20 @@ bun add @canonical/react-ds-app-launchpad
|
|
|
14
14
|
|
|
15
15
|
The package builds on top of `@canonical/react-ds-global`.
|
|
16
16
|
|
|
17
|
+
`@canonical/styles` comes with it as a dependency, but installing is not importing. Import it once, in your application's entry point:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import "@canonical/styles";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
or, from a stylesheet:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import url("@canonical/styles");
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then mark your root — `<html class="ds app comfortable">` — as the [`@canonical/styles` README](../../styles/main/README.md) describes. That one import is also what puts this package's stylesheets in a defined order against the rest of the design system's: see [Every component stylesheet is in `ds.components.apps-launchpad`](#every-component-stylesheet-is-in-dscomponentsapps-launchpad) below.
|
|
30
|
+
|
|
17
31
|
## Usage
|
|
18
32
|
|
|
19
33
|
```tsx
|
|
@@ -30,6 +44,46 @@ function CodeReview() {
|
|
|
30
44
|
}
|
|
31
45
|
```
|
|
32
46
|
|
|
47
|
+
## Styling
|
|
48
|
+
|
|
49
|
+
### Every component stylesheet is in `ds.components.apps-launchpad`
|
|
50
|
+
|
|
51
|
+
Every component stylesheet under `src/lib` is wrapped in one cascade layer:
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@layer ds.components.apps-launchpad {
|
|
55
|
+
.ds.markdown-editor {
|
|
56
|
+
/* … */
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The name comes from the tier this package implements. Component layers follow the design system's tier tree, one flat name per tier: `ds.components.global` for the components every application gets, `ds.components.apps` for the ones Canonical applications share, and `ds.components.apps-launchpad` for this package, which specialises them. `@canonical/styles` names the tiers one level up, so a name like this one is appended after them and sorts above the tier it specialises.
|
|
62
|
+
|
|
63
|
+
`src/lib/index.css` names the layer as its first rule and then imports every component stylesheet:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
@layer ds.components.apps-launchpad;
|
|
67
|
+
|
|
68
|
+
@import url("./MarkdownEditor/styles.css");
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
A layer takes its place in the order the first time its name is seen, so naming it there — before any component sheet can open a block with it — keeps that place the same whichever sheet a bundler emits first. Importing a component already brings its own stylesheet, so that file is for a consumer who wants every component's CSS in one import.
|
|
72
|
+
|
|
73
|
+
`.storybook/styles.css` is deliberately not wrapped: it is the Storybook harness rather than a component stylesheet, it is not published, and it carries no component rules.
|
|
74
|
+
|
|
75
|
+
Three things follow.
|
|
76
|
+
|
|
77
|
+
`@canonical/react-ds-global` and `@canonical/react-ds-app` are not wrapped yet — at the time of writing neither package's stylesheets carry a layer at all — so today they still beat this package for the opposite reason: unlayered beats layered, whatever the emit order. What the layer guarantees, once those packages land, is that a rule here beats their rule for the same component by cascade layer instead of by whichever bundle a loader emitted last. Nothing in this package restyles a component from either of them today — the class names do not overlap — so the layer is what makes it safe when one does.
|
|
78
|
+
|
|
79
|
+
The order needs `@canonical/styles` on the page, needs its statement first, and needs that statement to name the shared application tier, since this package's name is appended after the names already fixed. Measured in Chromium 151: with the statement as it stands today, a rule here beats the same rule in `ds.components.apps` when the shared package is emitted first and loses when it is emitted second; with the tiers named at the second level, which a change released alongside this one adds, it wins in both orders. Nothing under `src/lib` imports `@canonical/styles` — an application imports it once, as the installation instructions above say.
|
|
80
|
+
|
|
81
|
+
An application's own **unlayered** CSS now beats every rule in this package, whatever the selectors on either side, because an unlayered author rule outranks every layered one. That is CSS working as designed, and it is the deliberate escape hatch: an application that needs to override a component writes a plain rule and it wins. An application that does *not* want to win by accident puts its CSS in `@layer app`.
|
|
82
|
+
|
|
83
|
+
**Rule for contributors:** every component stylesheet under `src/lib` opens with that wrapper, `src/lib/index.css` names the layer and imports the new sheet. `@keyframes` and a component's own `:root` token defaults go inside the wrapper; `@property` and `@font-face` registrations stay outside, above the block, because no layer sorts a registration. Never reach for `!important` to win a fight — an important declaration inverts the layer order, so it cannot be arbitrated by layers at all. The "Cascade Layers" section of the `@canonical/styles` README is the reference for the full order and for what is deliberately left unlayered.
|
|
84
|
+
|
|
85
|
+
One stylesheet here is a vendor theme rather than component styles: `GitDiffViewer/common/CodeDiffViewer/HighlighTheme.css` colours highlight.js's own `.hljs` classes, which no component in this package writes. It belongs in this layer, because it is shipped and imported by the two components that use it and anything else would let it outrank them; but its selectors carry no `.ds` compound, so they match those classes anywhere on a consumer's page. Scoping them to the components that load them is carried to the component-hygiene change.
|
|
86
|
+
|
|
33
87
|
## Storybook
|
|
34
88
|
|
|
35
89
|
```bash
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.12
|
|
2
|
-
|
|
3
|
-
> span {
|
|
4
|
-
padding: var(--diff-change-marker-detailed-padding);
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.12
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
.ds.detailed-change-marker {
|
|
6
|
+
> span {
|
|
7
|
+
padding: var(--diff-change-marker-detailed-padding);
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
&.added {
|
|
10
|
+
color: var(--diff-change-marker-added-color);
|
|
11
|
+
background-color: var(--diff-change-marker-added-alt);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.deleted {
|
|
15
|
+
color: var(--diff-change-marker-deleted-color);
|
|
16
|
+
background-color: var(--diff-change-marker-deleted-alt);
|
|
17
|
+
}
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
&.modified {
|
|
20
|
+
color: var(--diff-change-marker-modified-color);
|
|
21
|
+
background-color: var(--diff-change-marker-modified-alt);
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.12
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.12
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
.ds.simple-change-marker {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
height: var(--diff-change-marker-simple-size);
|
|
10
|
+
width: var(--diff-change-marker-simple-size);
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
> svg {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
&.added {
|
|
18
|
+
color: var(--diff-change-marker-added-svg);
|
|
19
|
+
background-color: var(--diff-change-marker-added-alt);
|
|
20
|
+
}
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
&.deleted {
|
|
23
|
+
color: var(--diff-change-marker-deleted-svg);
|
|
24
|
+
background-color: var(--diff-change-marker-deleted-alt);
|
|
25
|
+
}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
&.modified {
|
|
28
|
+
color: var(--diff-change-marker-modified-svg);
|
|
29
|
+
background-color: var(--diff-change-marker-modified-alt);
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.12
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.12
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
.ds.diff-change-marker {
|
|
6
|
+
--diff-change-marker-added-color: #8cd297;
|
|
7
|
+
--diff-change-marker-added-svg: #0e8420;
|
|
8
|
+
--diff-change-marker-added-alt: rgba(10, 189, 37, 0.1);
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
--diff-change-marker-deleted-color: #fba1aa;
|
|
11
|
+
--diff-change-marker-deleted-svg: #c7162b;
|
|
12
|
+
--diff-change-marker-deleted-alt: rgba(199, 0, 20, 0.1);
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
--diff-change-marker-modified-color: #c58c38;
|
|
15
|
+
--diff-change-marker-modified-svg: #cc7900;
|
|
16
|
+
--diff-change-marker-modified-alt: rgba(245, 158, 11, 0.1);
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
--diff-change-marker-font-size: 0.75rem;
|
|
19
|
+
--diff-change-marker-font-weight: 550;
|
|
20
|
+
--diff-change-marker-line-height: 1rem;
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
--diff-change-marker-simple-size: 1rem;
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
--diff-change-marker-detailed-padding: 0.125rem 0.25rem;
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
font-size: var(--diff-change-marker-font-size);
|
|
27
|
+
font-weight: var(--diff-change-marker-font-weight);
|
|
28
|
+
line-height: var(--diff-change-marker-line-height);
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
30
33
|
}
|
|
@@ -1,38 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
--editable-block-header-icon-size: 16px;
|
|
3
|
-
--editable-block-header-icon-edit-url: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 13.25v1.5H2v-1.5h12zM11.907 1.676l.58.58a2 2 0 010 2.829l-5.133 5.133c-.038.038-.079.073-.122.104l.01.008a3.77 3.77 0 01-1.718.983l-3.52.914.863-3.583c.138-.57.41-1.099.795-1.54l.17-.183.01.01c.03-.043.065-.084.103-.122l5.133-5.133a2 2 0 012.829 0zm-3.309 2.6L5.036 7.84l-.593.82 1.062 1.063.814-.591 3.567-3.568-1.288-1.288zm1.61-1.597l-.07.057-.479.48 1.288 1.288.48-.48a.5.5 0 00.057-.638l-.057-.069-.581-.58a.5.5 0 00-.638-.058z' fill='%23000000' fill-rule='nonzero'/%3E%3C/svg%3E");
|
|
4
|
-
--editable-block-header-icon-close-url: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000000' fill-rule='nonzero' d='M13.041 1.898l1.06 1.06L9.062 8l5.04 5.042-1.06 1.06L8 9.062 2.96 14.1l-1.06-1.06L6.938 8 1.9 2.96l1.06-1.06 5.04 5.04z'/%3E%3C/svg%3E");
|
|
5
|
-
--editable-block-header-title-font-weight: 550;
|
|
1
|
+
/* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
@layer ds.components.apps-launchpad {
|
|
4
|
+
.ds.editable-block {
|
|
5
|
+
--editable-block-header-icon-size: 16px;
|
|
6
|
+
--editable-block-header-icon-edit-url: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 13.25v1.5H2v-1.5h12zM11.907 1.676l.58.58a2 2 0 010 2.829l-5.133 5.133c-.038.038-.079.073-.122.104l.01.008a3.77 3.77 0 01-1.718.983l-3.52.914.863-3.583c.138-.57.41-1.099.795-1.54l.17-.183.01.01c.03-.043.065-.084.103-.122l5.133-5.133a2 2 0 012.829 0zm-3.309 2.6L5.036 7.84l-.593.82 1.062 1.063.814-.591 3.567-3.568-1.288-1.288zm1.61-1.597l-.07.057-.479.48 1.288 1.288.48-.48a.5.5 0 00.057-.638l-.057-.069-.581-.58a.5.5 0 00-.638-.058z' fill='%23000000' fill-rule='nonzero'/%3E%3C/svg%3E");
|
|
7
|
+
--editable-block-header-icon-close-url: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000000' fill-rule='nonzero' d='M13.041 1.898l1.06 1.06L9.062 8l5.04 5.042-1.06 1.06L8 9.062 2.96 14.1l-1.06-1.06L6.938 8 1.9 2.96l1.06-1.06 5.04 5.04z'/%3E%3C/svg%3E");
|
|
8
|
+
--editable-block-header-title-font-weight: 550;
|
|
11
9
|
|
|
12
|
-
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
background-repeat: no-repeat;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|
|
10
|
+
> header {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
align-items: center;
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
> .icon {
|
|
16
|
+
width: var(--editable-block-header-icon-size);
|
|
17
|
+
height: var(--editable-block-header-icon-size);
|
|
18
|
+
background-size: contain;
|
|
19
|
+
background-repeat: no-repeat;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
> .icon-edit {
|
|
24
|
+
background-image: var(--editable-block-header-icon-edit-url);
|
|
25
|
+
}
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
> .icon-close {
|
|
28
|
+
background-image: var(--editable-block-header-icon-close-url);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
> .title {
|
|
32
|
+
flex: 1;
|
|
33
|
+
text-align: left;
|
|
34
|
+
font-weight: var(--editable-block-header-title-font-weight);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
|
-
}
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
> .content {
|
|
39
|
+
flex-grow: 1;
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
3
|
+
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
/*
|
|
6
|
+
.ds.node.file {
|
|
7
|
+
} */
|
|
8
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
3
|
+
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
/*
|
|
6
|
+
.ds.node.folder {
|
|
7
|
+
} */
|
|
8
|
+
}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
.ds.indentation-block {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
gap: var(--file-tree-node-items-gap);
|
|
8
|
+
align-items: center;
|
|
9
|
+
user-select: none;
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
& > .indent-block {
|
|
12
|
+
width: var(--file-tree-node-indent-width);
|
|
13
|
+
position: relative;
|
|
14
|
+
isolation: isolate;
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
padding: var(--file-tree-node-vertical-padding) 0;
|
|
17
|
+
&:not(.empty)::before {
|
|
18
|
+
content: "";
|
|
19
|
+
display: block;
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 50%;
|
|
22
|
+
top: 0;
|
|
23
|
+
bottom: 0;
|
|
24
|
+
transform: translateX(-50%);
|
|
25
|
+
width: var(--file-tree-node-indent-bar-width);
|
|
26
|
+
height: 100%;
|
|
27
|
+
background-color: var(--file-tree-node-indent-bar-color);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&:has(> .indent-block.empty) {
|
|
31
|
+
width: 0;
|
|
32
|
+
margin-left: calc(-1 * var(--file-tree-node-items-gap));
|
|
26
33
|
}
|
|
27
|
-
}
|
|
28
|
-
&:has(> .indent-block.empty) {
|
|
29
|
-
width: 0;
|
|
30
|
-
margin-left: calc(-1 * var(--file-tree-node-items-gap));
|
|
31
34
|
}
|
|
32
35
|
}
|
|
@@ -1,56 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
list-style: none;
|
|
3
|
-
display: flex;
|
|
4
|
-
gap: var(--file-tree-node-items-gap);
|
|
5
|
-
align-items: center;
|
|
1
|
+
/* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
@layer ds.components.apps-launchpad {
|
|
4
|
+
.ds.node {
|
|
5
|
+
list-style: none;
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: var(--file-tree-node-items-gap);
|
|
8
|
+
align-items: center;
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
color: var(--file-tree-node-text-color-default);
|
|
15
|
-
border-left: 2px solid var(--file-tree-node-border-color);
|
|
10
|
+
font-size: var(--file-tree-node-text-size);
|
|
11
|
+
font-weight: var(--file-tree-node-text-weight);
|
|
12
|
+
line-height: var(--file-tree-node-text-line-height);
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cursor:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
14
|
+
/* vertical padding is set on the indentation level */
|
|
15
|
+
padding: 0 var(--file-tree-node-horizontal-padding);
|
|
16
|
+
cursor: default;
|
|
17
|
+
color: var(--file-tree-node-text-color-default);
|
|
18
|
+
border-left: 2px solid var(--file-tree-node-border-color);
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
20
|
+
&.selectable,
|
|
21
|
+
&.expandable {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
&:hover {
|
|
24
|
+
background-color: var(--file-tree-node-background-color-hover);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
&.selected,
|
|
29
|
+
&.selectable:focus,
|
|
30
|
+
&.expandable:focus {
|
|
31
|
+
color: var(--file-tree-node-text-color-active);
|
|
32
|
+
background-color: var(--file-tree-node-background-color-active);
|
|
33
|
+
border-color: var(--file-tree-node-border-color-active);
|
|
34
|
+
font-weight: var(--file-tree-node-text-weight-active);
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
|
|
37
|
+
& > .icon {
|
|
38
|
+
user-select: none;
|
|
39
|
+
width: var(--file-tree-node-icon-size);
|
|
40
|
+
&.file {
|
|
41
|
+
content: var(--file-tree-node-file-icon);
|
|
42
|
+
}
|
|
43
|
+
&.folder {
|
|
44
|
+
content: var(--file-tree-node-closed-folder-icon);
|
|
45
|
+
&.expanded {
|
|
46
|
+
content: var(--file-tree-node-opened-folder-icon);
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
& > .nodename {
|
|
51
|
+
flex: 1;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
}
|
|
56
|
+
& > .marker {
|
|
57
|
+
display: inline-block;
|
|
58
|
+
}
|
|
55
59
|
}
|
|
56
60
|
}
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
1
|
+
/* @canonical/generator-ds 0.9.0-experimental.4
|
|
2
|
+
* Layer: ds.components.apps-launchpad (@canonical/styles README, "Cascade layers"). */
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var(--file-tree-search-box-
|
|
9
|
-
|
|
4
|
+
@layer ds.components.apps-launchpad {
|
|
5
|
+
.ds.search-box {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
border-bottom: 1px solid var(--file-tree-search-box-border-color);
|
|
9
|
+
padding: var(--file-tree-search-box-vertical-padding)
|
|
10
|
+
var(--file-tree-search-box-horizontal-padding);
|
|
11
|
+
background-color: var(--file-tree-search-box-background-color);
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
position: sticky;
|
|
14
|
+
top: 0;
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
&:focus-within {
|
|
17
|
+
outline: 2px solid Highlight;
|
|
18
|
+
/* biome-ignore lint/suspicious/noDuplicateProperties: fallback for browsers without -webkit-focus-ring-color */
|
|
19
|
+
outline: 2px solid -webkit-focus-ring-color;
|
|
20
|
+
outline-offset: -1px;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
& > .input {
|
|
24
|
+
flex: 1 1 100%;
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
vertical-align: baseline;
|
|
27
|
+
font-size: 1rem;
|
|
28
|
+
line-height: var(--file-tree-search-box-line-height);
|
|
29
|
+
}
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
& > .search,
|
|
32
|
+
& > .reset {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
width: var(--file-tree-search-box-button-size);
|
|
35
|
+
height: var(--file-tree-search-box-button-size);
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
border: none;
|
|
41
|
+
}
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
& > .input:not(:valid) ~ .reset {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
& > .search > .icon {
|
|
48
|
+
content: var(--file-tree-search-box-search-icon);
|
|
49
|
+
}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
& > .reset > .icon {
|
|
52
|
+
content: var(--file-tree-search-box-reset-icon);
|
|
53
|
+
}
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
/* remove search input default appearance */
|
|
56
|
+
& > .input {
|
|
57
|
+
border: none;
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
background-color: transparent;
|
|
60
|
+
border-color: transparent;
|
|
61
|
+
outline: none;
|
|
62
|
+
&::-webkit-search-cancel-button {
|
|
63
|
+
appearance: none;
|
|
64
|
+
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
}
|