@canonical/svelte-ds-app-launchpad 0.25.0 → 0.27.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/dist/components/NumberInput/types.d.ts +2 -2
- package/dist/components/Popover/Popover.svelte +1 -1
- package/dist/components/SearchBox/SearchBox.svelte +79 -0
- package/dist/components/SearchBox/SearchBox.svelte.d.ts +36 -0
- package/dist/components/SearchBox/common/SearchButton/SearchButton.svelte +31 -0
- package/dist/components/SearchBox/common/SearchButton/SearchButton.svelte.d.ts +5 -0
- package/dist/components/SearchBox/common/SearchButton/index.d.ts +2 -0
- package/dist/components/SearchBox/common/SearchButton/index.js +1 -0
- package/dist/components/SearchBox/common/SearchButton/styles.css +11 -0
- package/dist/components/SearchBox/common/SearchButton/types.d.ts +2 -0
- package/dist/components/SearchBox/common/SearchButton/types.js +1 -0
- package/dist/components/SearchBox/common/index.d.ts +1 -0
- package/dist/components/SearchBox/common/index.js +1 -0
- package/dist/components/SearchBox/context.d.ts +2 -0
- package/dist/components/SearchBox/context.js +2 -0
- package/dist/components/SearchBox/index.d.ts +22 -0
- package/dist/components/SearchBox/index.js +6 -0
- package/dist/components/SearchBox/styles.css +35 -0
- package/dist/components/SearchBox/types.d.ts +26 -0
- package/dist/components/SearchBox/types.js +2 -0
- package/dist/components/Select/Select.svelte +51 -0
- package/dist/components/Select/Select.svelte.d.ts +17 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +3 -0
- package/dist/components/Select/styles.css +161 -0
- package/dist/components/Select/types.d.ts +7 -0
- package/dist/components/Select/types.js +2 -0
- package/dist/components/SidePanel/SidePanel.svelte +34 -0
- package/dist/components/SidePanel/SidePanel.svelte.d.ts +13 -0
- package/dist/components/SidePanel/index.d.ts +72 -0
- package/dist/components/SidePanel/index.js +7 -0
- package/dist/components/SidePanel/styles.css +37 -0
- package/dist/components/SidePanel/types.d.ts +3 -0
- package/dist/components/SidePanel/types.js +2 -0
- package/dist/components/Table/Table.svelte +52 -0
- package/dist/components/Table/Table.svelte.d.ts +41 -0
- package/dist/components/Table/common/TH/TH.svelte +40 -0
- package/dist/components/Table/common/TH/TH.svelte.d.ts +5 -0
- package/dist/components/Table/common/TH/common/SortButton/SortButton.svelte +36 -0
- package/dist/components/Table/common/TH/common/SortButton/SortButton.svelte.d.ts +5 -0
- package/dist/components/Table/common/TH/common/SortButton/index.d.ts +2 -0
- package/dist/components/Table/common/TH/common/SortButton/index.js +3 -0
- package/dist/components/Table/common/TH/common/SortButton/styles.css +19 -0
- package/dist/components/Table/common/TH/common/SortButton/types.d.ts +10 -0
- package/dist/components/Table/common/TH/common/SortButton/types.js +2 -0
- package/dist/components/Table/common/TH/common/index.d.ts +1 -0
- package/dist/components/Table/common/TH/common/index.js +1 -0
- package/dist/components/Table/common/TH/context.d.ts +2 -0
- package/dist/components/Table/common/TH/context.js +2 -0
- package/dist/components/Table/common/TH/index.d.ts +10 -0
- package/dist/components/Table/common/TH/index.js +7 -0
- package/dist/components/Table/common/TH/styles.css +22 -0
- package/dist/components/Table/common/TH/types.d.ts +21 -0
- package/dist/components/Table/common/TH/types.js +2 -0
- package/dist/components/Table/common/index.d.ts +1 -0
- package/dist/components/Table/common/index.js +1 -0
- package/dist/components/Table/index.d.ts +21 -0
- package/dist/components/Table/index.js +6 -0
- package/dist/components/Table/styles.css +46 -0
- package/dist/components/Table/types.d.ts +2 -0
- package/dist/components/Table/types.js +2 -0
- package/dist/components/TextInput/types.d.ts +2 -2
- package/dist/components/Timeline/Timeline.svelte +51 -0
- package/dist/components/Timeline/Timeline.svelte.d.ts +40 -0
- package/dist/components/Timeline/common/Event/Event.svelte +54 -0
- package/dist/components/Timeline/common/Event/Event.svelte.d.ts +5 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/TitleRow.svelte +32 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/TitleRow.svelte.d.ts +5 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/index.d.ts +2 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/index.js +3 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/styles.css +38 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/types.d.ts +18 -0
- package/dist/components/Timeline/common/Event/common/TitleRow/types.js +2 -0
- package/dist/components/Timeline/common/Event/common/index.d.ts +1 -0
- package/dist/components/Timeline/common/Event/common/index.js +1 -0
- package/dist/components/Timeline/common/Event/index.d.ts +20 -0
- package/dist/components/Timeline/common/Event/index.js +7 -0
- package/dist/components/Timeline/common/Event/styles.css +115 -0
- package/dist/components/Timeline/common/Event/types.d.ts +25 -0
- package/dist/components/Timeline/common/Event/types.js +2 -0
- package/dist/components/Timeline/common/HiddenEvents/HiddenEvents.svelte +24 -0
- package/dist/components/Timeline/common/HiddenEvents/HiddenEvents.svelte.d.ts +5 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/Link.svelte +15 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/Link.svelte.d.ts +6 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/index.d.ts +2 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/index.js +3 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/styles.css +9 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/types.d.ts +2 -0
- package/dist/components/Timeline/common/HiddenEvents/common/Link/types.js +2 -0
- package/dist/components/Timeline/common/HiddenEvents/common/index.d.ts +1 -0
- package/dist/components/Timeline/common/HiddenEvents/common/index.js +1 -0
- package/dist/components/Timeline/common/HiddenEvents/index.d.ts +17 -0
- package/dist/components/Timeline/common/HiddenEvents/index.js +7 -0
- package/dist/components/Timeline/common/HiddenEvents/styles.css +42 -0
- package/dist/components/Timeline/common/HiddenEvents/types.d.ts +9 -0
- package/dist/components/Timeline/common/HiddenEvents/types.js +2 -0
- package/dist/components/Timeline/common/index.d.ts +2 -0
- package/dist/components/Timeline/common/index.js +2 -0
- package/dist/components/Timeline/index.d.ts +39 -0
- package/dist/components/Timeline/index.js +8 -0
- package/dist/components/Timeline/styles.css +12 -0
- package/dist/components/Timeline/types.d.ts +2 -0
- package/dist/components/Timeline/types.js +2 -0
- package/dist/components/Tooltip/Tooltip.svelte +165 -0
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +23 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.js +3 -0
- package/dist/components/Tooltip/styles.css +111 -0
- package/dist/components/Tooltip/types.d.ts +43 -0
- package/dist/components/Tooltip/types.js +2 -0
- package/dist/components/Tooltip/utils/ChainingManager.d.ts +18 -0
- package/dist/components/Tooltip/utils/ChainingManager.js +29 -0
- package/dist/components/Tooltip/utils/useDelayedOpen.svelte.d.ts +15 -0
- package/dist/components/Tooltip/utils/useDelayedOpen.svelte.js +42 -0
- package/dist/components/Tooltip/utils/useTooltipPosition.svelte.d.ts +24 -0
- package/dist/components/Tooltip/utils/useTooltipPosition.svelte.js +40 -0
- package/dist/components/UserAvatar/UserAvatar.svelte +63 -0
- package/dist/components/UserAvatar/UserAvatar.svelte.d.ts +17 -0
- package/dist/components/UserAvatar/index.d.ts +2 -0
- package/dist/components/UserAvatar/index.js +3 -0
- package/dist/components/UserAvatar/styles.css +66 -0
- package/dist/components/UserAvatar/types.d.ts +12 -0
- package/dist/components/UserAvatar/types.js +2 -0
- package/dist/components/UserAvatar/utils/getInitials.d.ts +1 -0
- package/dist/components/UserAvatar/utils/getInitials.js +8 -0
- package/dist/components/UserAvatar/utils/index.d.ts +1 -0
- package/dist/components/UserAvatar/utils/index.js +1 -0
- package/dist/components/icons/SortIcon.svelte +25 -0
- package/dist/components/icons/SortIcon.svelte.d.ts +4 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/type-utils/DistributiveOmit.d.ts +4 -0
- package/dist/type-utils/DistributiveOmit.js +1 -0
- package/dist/type-utils/index.d.ts +1 -0
- package/dist/type-utils/index.js +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DialogContent } from "../common/index.js";
|
|
2
|
+
import { default as SidePanelRoot } from "./SidePanel.svelte";
|
|
3
|
+
declare const SidePanel: typeof SidePanelRoot & {
|
|
4
|
+
/**
|
|
5
|
+
* `SidePanel.Content` is a layout component that provides a structured container for the side panel's content.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```svelte
|
|
9
|
+
* <SidePanel.Content>
|
|
10
|
+
* <SidePanel.Content.Header>
|
|
11
|
+
* SidePanel Header
|
|
12
|
+
* <SidePanel.Content.Header.CloseButton {commandfor} command="close" />
|
|
13
|
+
* </SidePanel.Content.Header>
|
|
14
|
+
* <SidePanel.Content.Body>
|
|
15
|
+
* Main Content
|
|
16
|
+
* </SidePanel.Content.Body>
|
|
17
|
+
* <SidePanel.Content.Footer>
|
|
18
|
+
* <Button>Footer Button</Button>
|
|
19
|
+
* </SidePanel.Content.Footer>
|
|
20
|
+
* </SidePanel.Content>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
Content: typeof DialogContent & {
|
|
24
|
+
/**
|
|
25
|
+
* `SidePanel.Content.Header` represents the header section of the side panel.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```svelte
|
|
29
|
+
* <SidePanel.Content.Header>
|
|
30
|
+
* Header Content
|
|
31
|
+
* <SidePanel.Content.Header.CloseButton {commandfor} command="close" />
|
|
32
|
+
* </SidePanel.Content.Header>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
Header: typeof DialogContent.Header & {
|
|
36
|
+
/**
|
|
37
|
+
* `SidePanel.Content.Header.CloseButton` is a wrapper over `Button` meant to be used as a close button in side panel headers.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```svelte
|
|
41
|
+
* <SidePanel.Content.Header.CloseButton {commandfor} command="close" />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
CloseButton: typeof DialogContent.Header.CloseButton;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* `SidePanel.Content.Body` represents the main content area of the side panel.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```svelte
|
|
51
|
+
* <SidePanel.Content.Body>
|
|
52
|
+
* Main Content
|
|
53
|
+
* </SidePanel.Content.Body>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
Body: typeof DialogContent.Body;
|
|
57
|
+
/**
|
|
58
|
+
* `SidePanel.Content.Footer` represents the footer section of the side panel. Usually contains action buttons.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```svelte
|
|
62
|
+
* <SidePanel.Content.Footer>
|
|
63
|
+
* <Button>Cancel</Button>
|
|
64
|
+
* <Button>Confirm</Button>
|
|
65
|
+
* </SidePanel.Content.Footer>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
Footer: typeof DialogContent.Footer;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export * from "./types.js";
|
|
72
|
+
export { SidePanel };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.2 */
|
|
2
|
+
import { DialogContent } from "../common/index.js";
|
|
3
|
+
import { default as SidePanelRoot } from "./SidePanel.svelte";
|
|
4
|
+
const SidePanel = SidePanelRoot;
|
|
5
|
+
SidePanel.Content = DialogContent;
|
|
6
|
+
export * from "./types.js";
|
|
7
|
+
export { SidePanel };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.ds.ds.side-panel {
|
|
2
|
+
/* TODO: Replace with a token */
|
|
3
|
+
--dimension-width-modal: 33.5rem;
|
|
4
|
+
|
|
5
|
+
margin: 0 0 0 auto;
|
|
6
|
+
opacity: 1;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
|
|
9
|
+
/* User-agent styles reset */
|
|
10
|
+
max-height: unset;
|
|
11
|
+
border: none;
|
|
12
|
+
|
|
13
|
+
box-shadow: 0 0 32px 0 rgba(0, 0, 0, 0.2);
|
|
14
|
+
transform: translateX(100%);
|
|
15
|
+
transition-property: display, transform, overlay;
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
[open] is a fallback for Safari that doesn't support the `:open`.
|
|
19
|
+
|
|
20
|
+
TODO(:open): Remove when Safari supports it (https://developer.mozilla.org/en-US/docs/Web/CSS/:open)
|
|
21
|
+
*/
|
|
22
|
+
&:is(:open, [open]) {
|
|
23
|
+
transform: translateX(0);
|
|
24
|
+
|
|
25
|
+
@starting-style {
|
|
26
|
+
transform: translateX(100%);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&::backdrop {
|
|
31
|
+
background-color: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ds.dialog-content {
|
|
35
|
+
min-height: 100%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!-- @canonical/generator-ds 0.10.0-experimental.5 -->
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import type { TableProps } from "./types.js";
|
|
5
|
+
import "./styles.css";
|
|
6
|
+
|
|
7
|
+
const componentCssClassName = "ds table";
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: TableProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<table class={[componentCssClassName, className]} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</table>
|
|
15
|
+
|
|
16
|
+
<!-- @component
|
|
17
|
+
`Table` is a styled table element.
|
|
18
|
+
|
|
19
|
+
## Example Usage
|
|
20
|
+
```svelte
|
|
21
|
+
<Table>
|
|
22
|
+
<caption>Sample Data</caption>
|
|
23
|
+
<thead>
|
|
24
|
+
<tr>
|
|
25
|
+
<Table.TH aria-sort="ascending" scope="col">
|
|
26
|
+
Sortable Column
|
|
27
|
+
{#snippet action()}
|
|
28
|
+
<Table.TH.SortButton onclick={handleSortClick} aria-label="Sort descending by Sortable Column" />
|
|
29
|
+
{/snippet}
|
|
30
|
+
</Table.TH>
|
|
31
|
+
<th scope="col">Non-Sortable Column</th>
|
|
32
|
+
</tr>
|
|
33
|
+
</thead>
|
|
34
|
+
<tbody>
|
|
35
|
+
<tr>
|
|
36
|
+
<td>Data 1</td>
|
|
37
|
+
<td>Data 2</td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td>Data 3</td>
|
|
41
|
+
<td>Data 4</td>
|
|
42
|
+
</tr>
|
|
43
|
+
</tbody>
|
|
44
|
+
<tfoot>
|
|
45
|
+
<tr>
|
|
46
|
+
<td>Footer 1</td>
|
|
47
|
+
<td>Footer 2</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</tfoot>
|
|
50
|
+
</Table>
|
|
51
|
+
```
|
|
52
|
+
-->
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
/**
|
|
3
|
+
* `Table` is a styled table element.
|
|
4
|
+
*
|
|
5
|
+
* ## Example Usage
|
|
6
|
+
* ```svelte
|
|
7
|
+
* <Table>
|
|
8
|
+
* <caption>Sample Data</caption>
|
|
9
|
+
* <thead>
|
|
10
|
+
* <tr>
|
|
11
|
+
* <Table.TH aria-sort="ascending" scope="col">
|
|
12
|
+
* Sortable Column
|
|
13
|
+
* {#snippet action()}
|
|
14
|
+
* <Table.TH.SortButton onclick={handleSortClick} aria-label="Sort descending by Sortable Column" />
|
|
15
|
+
* {/snippet}
|
|
16
|
+
* </Table.TH>
|
|
17
|
+
* <th scope="col">Non-Sortable Column</th>
|
|
18
|
+
* </tr>
|
|
19
|
+
* </thead>
|
|
20
|
+
* <tbody>
|
|
21
|
+
* <tr>
|
|
22
|
+
* <td>Data 1</td>
|
|
23
|
+
* <td>Data 2</td>
|
|
24
|
+
* </tr>
|
|
25
|
+
* <tr>
|
|
26
|
+
* <td>Data 3</td>
|
|
27
|
+
* <td>Data 4</td>
|
|
28
|
+
* </tr>
|
|
29
|
+
* </tbody>
|
|
30
|
+
* <tfoot>
|
|
31
|
+
* <tr>
|
|
32
|
+
* <td>Footer 1</td>
|
|
33
|
+
* <td>Footer 2</td>
|
|
34
|
+
* </tr>
|
|
35
|
+
* </tfoot>
|
|
36
|
+
* </Table>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare const Table: import("svelte").Component<import("svelte/elements").HTMLTableAttributes, {}, "">;
|
|
40
|
+
type Table = ReturnType<typeof Table>;
|
|
41
|
+
export default Table;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!-- @canonical/generator-ds 0.10.0-experimental.5 -->
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { setTHContext } from "./context.js";
|
|
5
|
+
import type { THProps } from "./types.js";
|
|
6
|
+
import "./styles.css";
|
|
7
|
+
|
|
8
|
+
const componentCssClassName = "ds table-th";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: className,
|
|
12
|
+
children,
|
|
13
|
+
"aria-sort": sortDirection,
|
|
14
|
+
action,
|
|
15
|
+
...rest
|
|
16
|
+
}: THProps = $props();
|
|
17
|
+
|
|
18
|
+
const cellContentId = $props.id();
|
|
19
|
+
|
|
20
|
+
setTHContext({
|
|
21
|
+
get sortDirection() {
|
|
22
|
+
return sortDirection;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<th
|
|
28
|
+
class={[componentCssClassName, className]}
|
|
29
|
+
aria-sort={sortDirection}
|
|
30
|
+
// Omit actions from the cell's accessible name. Otherwise, when user navigates the table, the sort button's label (e.g. "Sort by Name ascending") would be included every time when a screen reader announces associated header cell.
|
|
31
|
+
aria-labelledby={cellContentId}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
<div>
|
|
35
|
+
<span id={cellContentId}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</span>
|
|
38
|
+
{@render action?.()}
|
|
39
|
+
</div>
|
|
40
|
+
</th>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!-- @canonical/generator-ds 0.10.0-experimental.5 -->
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { getTHContext } from "../../context.js";
|
|
5
|
+
import type { SortButtonProps } from "./types.js";
|
|
6
|
+
import "./styles.css";
|
|
7
|
+
import { ArrowDownIcon, ArrowUpIcon } from "@canonical/svelte-icons";
|
|
8
|
+
import { ButtonPrimitive } from "../../../../../common/index.js";
|
|
9
|
+
import { SortIcon } from "../../../../../icons/index.js";
|
|
10
|
+
|
|
11
|
+
const componentCssClassName = "ds table-th-sort";
|
|
12
|
+
|
|
13
|
+
let { class: className, ...rest }: SortButtonProps = $props();
|
|
14
|
+
|
|
15
|
+
const thContext = getTHContext();
|
|
16
|
+
const sortDirection = $derived(thContext.sortDirection);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<ButtonPrimitive
|
|
20
|
+
class={[
|
|
21
|
+
componentCssClassName,
|
|
22
|
+
className,
|
|
23
|
+
{
|
|
24
|
+
sorted: sortDirection && sortDirection !== "none",
|
|
25
|
+
},
|
|
26
|
+
]}
|
|
27
|
+
{...rest}
|
|
28
|
+
>
|
|
29
|
+
{#if sortDirection === "ascending"}
|
|
30
|
+
<ArrowUpIcon aria-hidden="true" />
|
|
31
|
+
{:else if sortDirection === "descending"}
|
|
32
|
+
<ArrowDownIcon aria-hidden="true" />
|
|
33
|
+
{:else}
|
|
34
|
+
<SortIcon aria-hidden="true" />
|
|
35
|
+
{/if}
|
|
36
|
+
</ButtonPrimitive>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.ds.table-th-sort.button-primitive {
|
|
2
|
+
padding: var(--lp-dimension-spacing-block-xxxs)
|
|
3
|
+
var(--lp-dimension-spacing-inline-xxxs);
|
|
4
|
+
background: none;
|
|
5
|
+
border: none;
|
|
6
|
+
min-width: fit-content;
|
|
7
|
+
|
|
8
|
+
font-size: var(--lp-typography-font-size-m);
|
|
9
|
+
color: var(--lp-color-icon-status-queued);
|
|
10
|
+
|
|
11
|
+
--color-background-button-hover: transparent;
|
|
12
|
+
--color-background-button-active: transparent;
|
|
13
|
+
|
|
14
|
+
&:hover,
|
|
15
|
+
&:focus-visible,
|
|
16
|
+
&.sorted {
|
|
17
|
+
color: var(--lp-color-text-default);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DistributiveOmit } from "../../../../../../type-utils/index.js";
|
|
2
|
+
import type { ButtonPrimitiveProps } from "../../../../../common/index.js";
|
|
3
|
+
export type SortButtonProps = DistributiveOmit<ButtonPrimitiveProps, "children"> & {
|
|
4
|
+
/**
|
|
5
|
+
* Label describing the sort action of the button.
|
|
6
|
+
*
|
|
7
|
+
* @example "Sort by Name ascending", "Sort by Name descending", "Remove sorting by Name"
|
|
8
|
+
*/
|
|
9
|
+
"aria-label": string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SortButton/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SortButton/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SortButton } from "./common/index.js";
|
|
2
|
+
import { default as THRoot } from "./TH.svelte";
|
|
3
|
+
declare const TH: typeof THRoot & {
|
|
4
|
+
/**
|
|
5
|
+
* A button that toggles the sort direction of the column.
|
|
6
|
+
*/
|
|
7
|
+
SortButton: typeof SortButton;
|
|
8
|
+
};
|
|
9
|
+
export * from "./types.js";
|
|
10
|
+
export { TH };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.ds.table-th {
|
|
2
|
+
div {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-flow: row wrap;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: var(--lp-dimension-spacing-inline-xxs);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&:not([aria-sort]),
|
|
11
|
+
&[aria-sort="none"] {
|
|
12
|
+
.ds.table-th-sort:not(:focus-visible) {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
.ds.table-th-sort {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLThAttributes } from "svelte/elements";
|
|
3
|
+
type BaseProps = HTMLThAttributes;
|
|
4
|
+
export interface THProps extends BaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* The sort direction of the column.
|
|
7
|
+
*
|
|
8
|
+
* Provided value will be applied to the `aria-sort` attribute of the header and used to determine the visual state of the `TH.SortButton` if included as an action.
|
|
9
|
+
*/
|
|
10
|
+
"aria-sort"?: HTMLThAttributes["aria-sort"];
|
|
11
|
+
/**
|
|
12
|
+
* A button or link to be included in the header cell.
|
|
13
|
+
*
|
|
14
|
+
* Usually <Table.TH.SortButton>.
|
|
15
|
+
*/
|
|
16
|
+
action?: Snippet<[]>;
|
|
17
|
+
}
|
|
18
|
+
export type THContext = {
|
|
19
|
+
sortDirection: HTMLThAttributes["aria-sort"];
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TH/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TH/index.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TH } from "./common/index.js";
|
|
2
|
+
import { default as TableRoot } from "./Table.svelte";
|
|
3
|
+
declare const Table: typeof TableRoot & {
|
|
4
|
+
/**
|
|
5
|
+
* A table header cell component meant to be used for sortable columns.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```svelte
|
|
9
|
+
* <Table.TH aria-sort="ascending" scope="col">
|
|
10
|
+
* Sortable Column
|
|
11
|
+
* {#snippet action()}
|
|
12
|
+
* <Table.TH.SortButton onclick={handleSortClick} />
|
|
13
|
+
* {/snippet}
|
|
14
|
+
* </Table.TH>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
TH: typeof TH;
|
|
18
|
+
};
|
|
19
|
+
export type { THProps as TableTHProps } from "./common/index.js";
|
|
20
|
+
export * from "./types.js";
|
|
21
|
+
export { Table };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.ds.table {
|
|
2
|
+
border-collapse: collapse;
|
|
3
|
+
|
|
4
|
+
--border-table-row: var(--lp-dimension-stroke-thickness-default) solid
|
|
5
|
+
var(--lp-color-border-low-contrast);
|
|
6
|
+
--dimension-padding-block-table-cell: var(--lp-dimension-spacing-block-xs);
|
|
7
|
+
--dimension-padding-inline-table-cell: var(--lp-dimension-spacing-inline-xs);
|
|
8
|
+
|
|
9
|
+
th,
|
|
10
|
+
td {
|
|
11
|
+
padding-inline: var(--dimension-padding-inline-table-cell);
|
|
12
|
+
padding-block: var(--dimension-padding-block-table-cell);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
th {
|
|
16
|
+
text-align: start;
|
|
17
|
+
font: var(--lp-typography-paragraph-s-strong);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
td {
|
|
21
|
+
font: var(--lp-typography-paragraph-s);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
thead,
|
|
25
|
+
tr:not(:last-child) {
|
|
26
|
+
border-bottom: var(--border-table-row);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
tfoot {
|
|
30
|
+
border-top: var(--border-table-row);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
thead th {
|
|
34
|
+
position: relative;
|
|
35
|
+
|
|
36
|
+
&:not(:last-child)::after {
|
|
37
|
+
content: "";
|
|
38
|
+
position: absolute;
|
|
39
|
+
height: calc(100% - var(--dimension-padding-block-table-cell) * 2);
|
|
40
|
+
width: var(--lp-dimension-stroke-thickness-default);
|
|
41
|
+
inset-inline-end: calc(var(--lp-dimension-stroke-thickness-default) / -2);
|
|
42
|
+
inset-block-start: var(--dimension-padding-block-table-cell);
|
|
43
|
+
background-color: var(--lp-color-border-default);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ModifierFamily } from "../../modifier-families/index.js";
|
|
1
|
+
import type { ModifierFamily, ModifierFamilyValues } from "../../modifier-families/index.js";
|
|
2
2
|
import type { TextInputPrimitiveProps } from "../common/index.js";
|
|
3
3
|
export interface TextInputProps extends TextInputPrimitiveProps, ModifierFamily<"severity"> {
|
|
4
|
-
density?: "dense" | "medium"
|
|
4
|
+
density?: Extract<ModifierFamilyValues["density"], "dense" | "medium">;
|
|
5
5
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!-- @canonical/generator-ds 0.10.0-experimental.2 -->
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import type { TimelineProps } from "./types.js";
|
|
5
|
+
import "./styles.css";
|
|
6
|
+
|
|
7
|
+
const componentCssClassName = "ds timeline";
|
|
8
|
+
|
|
9
|
+
let { class: className, children, ...rest }: TimelineProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ol class={[componentCssClassName, className]} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ol>
|
|
15
|
+
|
|
16
|
+
<!-- @component
|
|
17
|
+
`Timeline` component represents a vertical timeline that displays a series of events in chronological order.
|
|
18
|
+
|
|
19
|
+
## Example Usage
|
|
20
|
+
```svelte
|
|
21
|
+
<Timeline>
|
|
22
|
+
<Timeline.Event marker={{userName: "Alvarez Daniella"}} markerSize="large">
|
|
23
|
+
{#snippet titleRow()}
|
|
24
|
+
<Timeline.Event.TitleRow leadingText="Alvarez Daniella">
|
|
25
|
+
did some cool stuff
|
|
26
|
+
{#snippet date()}
|
|
27
|
+
<DateTime date="2023-03-15" />
|
|
28
|
+
{/snippet}
|
|
29
|
+
</Timeline.Event.TitleRow>
|
|
30
|
+
{/snippet}
|
|
31
|
+
Description of the stuff that was done.
|
|
32
|
+
</Timeline.Event>
|
|
33
|
+
<Timeline.Event>
|
|
34
|
+
{#snippet marker()}
|
|
35
|
+
<StarredIcon />
|
|
36
|
+
{/snippet}
|
|
37
|
+
{#snippet titleRow()}
|
|
38
|
+
<Timeline.Event.TitleRow leadingText="Alvarez Daniella">
|
|
39
|
+
did other amazing things
|
|
40
|
+
{#snippet date()}
|
|
41
|
+
<DateTime date="2023-03-15" />
|
|
42
|
+
{/snippet}
|
|
43
|
+
</Timeline.Event.TitleRow>
|
|
44
|
+
{/snippet}
|
|
45
|
+
</Timeline.Event>
|
|
46
|
+
<Timeline.HiddenEvents numHidden={3}>
|
|
47
|
+
<Timeline.HiddenEvents.Link href="?show-all">Show all</Timeline.HiddenEvents.Link>
|
|
48
|
+
</Timeline.HiddenEvents>
|
|
49
|
+
</Timeline>
|
|
50
|
+
```
|
|
51
|
+
-->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
/**
|
|
3
|
+
* `Timeline` component represents a vertical timeline that displays a series of events in chronological order.
|
|
4
|
+
*
|
|
5
|
+
* ## Example Usage
|
|
6
|
+
* ```svelte
|
|
7
|
+
* <Timeline>
|
|
8
|
+
* <Timeline.Event marker={{userName: "Alvarez Daniella"}} markerSize="large">
|
|
9
|
+
* {#snippet titleRow()}
|
|
10
|
+
* <Timeline.Event.TitleRow leadingText="Alvarez Daniella">
|
|
11
|
+
* did some cool stuff
|
|
12
|
+
* {#snippet date()}
|
|
13
|
+
* <DateTime date="2023-03-15" />
|
|
14
|
+
* {/snippet}
|
|
15
|
+
* </Timeline.Event.TitleRow>
|
|
16
|
+
* {/snippet}
|
|
17
|
+
* Description of the stuff that was done.
|
|
18
|
+
* </Timeline.Event>
|
|
19
|
+
* <Timeline.Event>
|
|
20
|
+
* {#snippet marker()}
|
|
21
|
+
* <StarredIcon />
|
|
22
|
+
* {/snippet}
|
|
23
|
+
* {#snippet titleRow()}
|
|
24
|
+
* <Timeline.Event.TitleRow leadingText="Alvarez Daniella">
|
|
25
|
+
* did other amazing things
|
|
26
|
+
* {#snippet date()}
|
|
27
|
+
* <DateTime date="2023-03-15" />
|
|
28
|
+
* {/snippet}
|
|
29
|
+
* </Timeline.Event.TitleRow>
|
|
30
|
+
* {/snippet}
|
|
31
|
+
* </Timeline.Event>
|
|
32
|
+
* <Timeline.HiddenEvents numHidden={3}>
|
|
33
|
+
* <Timeline.HiddenEvents.Link href="?show-all">Show all</Timeline.HiddenEvents.Link>
|
|
34
|
+
* </Timeline.HiddenEvents>
|
|
35
|
+
* </Timeline>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const Timeline: import("svelte").Component<import("svelte/elements").HTMLOlAttributes, {}, "">;
|
|
39
|
+
type Timeline = ReturnType<typeof Timeline>;
|
|
40
|
+
export default Timeline;
|