@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.
Files changed (138) hide show
  1. package/dist/components/NumberInput/types.d.ts +2 -2
  2. package/dist/components/Popover/Popover.svelte +1 -1
  3. package/dist/components/SearchBox/SearchBox.svelte +79 -0
  4. package/dist/components/SearchBox/SearchBox.svelte.d.ts +36 -0
  5. package/dist/components/SearchBox/common/SearchButton/SearchButton.svelte +31 -0
  6. package/dist/components/SearchBox/common/SearchButton/SearchButton.svelte.d.ts +5 -0
  7. package/dist/components/SearchBox/common/SearchButton/index.d.ts +2 -0
  8. package/dist/components/SearchBox/common/SearchButton/index.js +1 -0
  9. package/dist/components/SearchBox/common/SearchButton/styles.css +11 -0
  10. package/dist/components/SearchBox/common/SearchButton/types.d.ts +2 -0
  11. package/dist/components/SearchBox/common/SearchButton/types.js +1 -0
  12. package/dist/components/SearchBox/common/index.d.ts +1 -0
  13. package/dist/components/SearchBox/common/index.js +1 -0
  14. package/dist/components/SearchBox/context.d.ts +2 -0
  15. package/dist/components/SearchBox/context.js +2 -0
  16. package/dist/components/SearchBox/index.d.ts +22 -0
  17. package/dist/components/SearchBox/index.js +6 -0
  18. package/dist/components/SearchBox/styles.css +35 -0
  19. package/dist/components/SearchBox/types.d.ts +26 -0
  20. package/dist/components/SearchBox/types.js +2 -0
  21. package/dist/components/Select/Select.svelte +51 -0
  22. package/dist/components/Select/Select.svelte.d.ts +17 -0
  23. package/dist/components/Select/index.d.ts +2 -0
  24. package/dist/components/Select/index.js +3 -0
  25. package/dist/components/Select/styles.css +161 -0
  26. package/dist/components/Select/types.d.ts +7 -0
  27. package/dist/components/Select/types.js +2 -0
  28. package/dist/components/SidePanel/SidePanel.svelte +34 -0
  29. package/dist/components/SidePanel/SidePanel.svelte.d.ts +13 -0
  30. package/dist/components/SidePanel/index.d.ts +72 -0
  31. package/dist/components/SidePanel/index.js +7 -0
  32. package/dist/components/SidePanel/styles.css +37 -0
  33. package/dist/components/SidePanel/types.d.ts +3 -0
  34. package/dist/components/SidePanel/types.js +2 -0
  35. package/dist/components/Table/Table.svelte +52 -0
  36. package/dist/components/Table/Table.svelte.d.ts +41 -0
  37. package/dist/components/Table/common/TH/TH.svelte +40 -0
  38. package/dist/components/Table/common/TH/TH.svelte.d.ts +5 -0
  39. package/dist/components/Table/common/TH/common/SortButton/SortButton.svelte +36 -0
  40. package/dist/components/Table/common/TH/common/SortButton/SortButton.svelte.d.ts +5 -0
  41. package/dist/components/Table/common/TH/common/SortButton/index.d.ts +2 -0
  42. package/dist/components/Table/common/TH/common/SortButton/index.js +3 -0
  43. package/dist/components/Table/common/TH/common/SortButton/styles.css +19 -0
  44. package/dist/components/Table/common/TH/common/SortButton/types.d.ts +10 -0
  45. package/dist/components/Table/common/TH/common/SortButton/types.js +2 -0
  46. package/dist/components/Table/common/TH/common/index.d.ts +1 -0
  47. package/dist/components/Table/common/TH/common/index.js +1 -0
  48. package/dist/components/Table/common/TH/context.d.ts +2 -0
  49. package/dist/components/Table/common/TH/context.js +2 -0
  50. package/dist/components/Table/common/TH/index.d.ts +10 -0
  51. package/dist/components/Table/common/TH/index.js +7 -0
  52. package/dist/components/Table/common/TH/styles.css +22 -0
  53. package/dist/components/Table/common/TH/types.d.ts +21 -0
  54. package/dist/components/Table/common/TH/types.js +2 -0
  55. package/dist/components/Table/common/index.d.ts +1 -0
  56. package/dist/components/Table/common/index.js +1 -0
  57. package/dist/components/Table/index.d.ts +21 -0
  58. package/dist/components/Table/index.js +6 -0
  59. package/dist/components/Table/styles.css +46 -0
  60. package/dist/components/Table/types.d.ts +2 -0
  61. package/dist/components/Table/types.js +2 -0
  62. package/dist/components/TextInput/types.d.ts +2 -2
  63. package/dist/components/Timeline/Timeline.svelte +51 -0
  64. package/dist/components/Timeline/Timeline.svelte.d.ts +40 -0
  65. package/dist/components/Timeline/common/Event/Event.svelte +54 -0
  66. package/dist/components/Timeline/common/Event/Event.svelte.d.ts +5 -0
  67. package/dist/components/Timeline/common/Event/common/TitleRow/TitleRow.svelte +32 -0
  68. package/dist/components/Timeline/common/Event/common/TitleRow/TitleRow.svelte.d.ts +5 -0
  69. package/dist/components/Timeline/common/Event/common/TitleRow/index.d.ts +2 -0
  70. package/dist/components/Timeline/common/Event/common/TitleRow/index.js +3 -0
  71. package/dist/components/Timeline/common/Event/common/TitleRow/styles.css +38 -0
  72. package/dist/components/Timeline/common/Event/common/TitleRow/types.d.ts +18 -0
  73. package/dist/components/Timeline/common/Event/common/TitleRow/types.js +2 -0
  74. package/dist/components/Timeline/common/Event/common/index.d.ts +1 -0
  75. package/dist/components/Timeline/common/Event/common/index.js +1 -0
  76. package/dist/components/Timeline/common/Event/index.d.ts +20 -0
  77. package/dist/components/Timeline/common/Event/index.js +7 -0
  78. package/dist/components/Timeline/common/Event/styles.css +115 -0
  79. package/dist/components/Timeline/common/Event/types.d.ts +25 -0
  80. package/dist/components/Timeline/common/Event/types.js +2 -0
  81. package/dist/components/Timeline/common/HiddenEvents/HiddenEvents.svelte +24 -0
  82. package/dist/components/Timeline/common/HiddenEvents/HiddenEvents.svelte.d.ts +5 -0
  83. package/dist/components/Timeline/common/HiddenEvents/common/Link/Link.svelte +15 -0
  84. package/dist/components/Timeline/common/HiddenEvents/common/Link/Link.svelte.d.ts +6 -0
  85. package/dist/components/Timeline/common/HiddenEvents/common/Link/index.d.ts +2 -0
  86. package/dist/components/Timeline/common/HiddenEvents/common/Link/index.js +3 -0
  87. package/dist/components/Timeline/common/HiddenEvents/common/Link/styles.css +9 -0
  88. package/dist/components/Timeline/common/HiddenEvents/common/Link/types.d.ts +2 -0
  89. package/dist/components/Timeline/common/HiddenEvents/common/Link/types.js +2 -0
  90. package/dist/components/Timeline/common/HiddenEvents/common/index.d.ts +1 -0
  91. package/dist/components/Timeline/common/HiddenEvents/common/index.js +1 -0
  92. package/dist/components/Timeline/common/HiddenEvents/index.d.ts +17 -0
  93. package/dist/components/Timeline/common/HiddenEvents/index.js +7 -0
  94. package/dist/components/Timeline/common/HiddenEvents/styles.css +42 -0
  95. package/dist/components/Timeline/common/HiddenEvents/types.d.ts +9 -0
  96. package/dist/components/Timeline/common/HiddenEvents/types.js +2 -0
  97. package/dist/components/Timeline/common/index.d.ts +2 -0
  98. package/dist/components/Timeline/common/index.js +2 -0
  99. package/dist/components/Timeline/index.d.ts +39 -0
  100. package/dist/components/Timeline/index.js +8 -0
  101. package/dist/components/Timeline/styles.css +12 -0
  102. package/dist/components/Timeline/types.d.ts +2 -0
  103. package/dist/components/Timeline/types.js +2 -0
  104. package/dist/components/Tooltip/Tooltip.svelte +165 -0
  105. package/dist/components/Tooltip/Tooltip.svelte.d.ts +23 -0
  106. package/dist/components/Tooltip/index.d.ts +2 -0
  107. package/dist/components/Tooltip/index.js +3 -0
  108. package/dist/components/Tooltip/styles.css +111 -0
  109. package/dist/components/Tooltip/types.d.ts +43 -0
  110. package/dist/components/Tooltip/types.js +2 -0
  111. package/dist/components/Tooltip/utils/ChainingManager.d.ts +18 -0
  112. package/dist/components/Tooltip/utils/ChainingManager.js +29 -0
  113. package/dist/components/Tooltip/utils/useDelayedOpen.svelte.d.ts +15 -0
  114. package/dist/components/Tooltip/utils/useDelayedOpen.svelte.js +42 -0
  115. package/dist/components/Tooltip/utils/useTooltipPosition.svelte.d.ts +24 -0
  116. package/dist/components/Tooltip/utils/useTooltipPosition.svelte.js +40 -0
  117. package/dist/components/UserAvatar/UserAvatar.svelte +63 -0
  118. package/dist/components/UserAvatar/UserAvatar.svelte.d.ts +17 -0
  119. package/dist/components/UserAvatar/index.d.ts +2 -0
  120. package/dist/components/UserAvatar/index.js +3 -0
  121. package/dist/components/UserAvatar/styles.css +66 -0
  122. package/dist/components/UserAvatar/types.d.ts +12 -0
  123. package/dist/components/UserAvatar/types.js +2 -0
  124. package/dist/components/UserAvatar/utils/getInitials.d.ts +1 -0
  125. package/dist/components/UserAvatar/utils/getInitials.js +8 -0
  126. package/dist/components/UserAvatar/utils/index.d.ts +1 -0
  127. package/dist/components/UserAvatar/utils/index.js +1 -0
  128. package/dist/components/icons/SortIcon.svelte +25 -0
  129. package/dist/components/icons/SortIcon.svelte.d.ts +4 -0
  130. package/dist/components/icons/index.d.ts +1 -0
  131. package/dist/components/icons/index.js +2 -0
  132. package/dist/components/index.d.ts +7 -0
  133. package/dist/components/index.js +7 -0
  134. package/dist/type-utils/DistributiveOmit.d.ts +4 -0
  135. package/dist/type-utils/DistributiveOmit.js +1 -0
  136. package/dist/type-utils/index.d.ts +1 -0
  137. package/dist/type-utils/index.js +1 -0
  138. 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,3 @@
1
+ import type { ModalProps } from "../Modal/index.js";
2
+ export type SidePanelProps = ModalProps;
3
+ export type { ModalMethods as SidePanelMethods, ModalTriggerProps as SidePanelTriggerProps, } from "../Modal/index.js";
@@ -0,0 +1,2 @@
1
+ /* @canonical/generator-ds 0.10.0-experimental.2 */
2
+ export {};
@@ -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,5 @@
1
+ import type { THProps } from "./types.js";
2
+ import "./styles.css";
3
+ declare const TH: import("svelte").Component<THProps, {}, "">;
4
+ type TH = ReturnType<typeof TH>;
5
+ export default 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,5 @@
1
+ import type { SortButtonProps } from "./types.js";
2
+ import "./styles.css";
3
+ declare const SortButton: import("svelte").Component<SortButtonProps, {}, "">;
4
+ type SortButton = ReturnType<typeof SortButton>;
5
+ export default SortButton;
@@ -0,0 +1,2 @@
1
+ export { default as SortButton } from "./SortButton.svelte";
2
+ export * from "./types.js";
@@ -0,0 +1,3 @@
1
+ /* @canonical/generator-ds 0.10.0-experimental.5 */
2
+ export { default as SortButton } from "./SortButton.svelte";
3
+ export * from "./types.js";
@@ -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,2 @@
1
+ /* @canonical/generator-ds 0.10.0-experimental.5 */
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./SortButton/index.js";
@@ -0,0 +1 @@
1
+ export * from "./SortButton/index.js";
@@ -0,0 +1,2 @@
1
+ import type { THContext } from "./types.js";
2
+ export declare const getTHContext: () => THContext, setTHContext: (context: THContext) => THContext;
@@ -0,0 +1,2 @@
1
+ import { createContext } from "svelte";
2
+ export const [getTHContext, setTHContext] = createContext();
@@ -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,7 @@
1
+ /* @canonical/generator-ds 0.10.0-experimental.5 */
2
+ import { SortButton } from "./common/index.js";
3
+ import { default as THRoot } from "./TH.svelte";
4
+ const TH = THRoot;
5
+ TH.SortButton = SortButton;
6
+ export * from "./types.js";
7
+ 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,2 @@
1
+ /* @canonical/generator-ds 0.10.0-experimental.5 */
2
+ 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,6 @@
1
+ import { TH } from "./common/index.js";
2
+ import { default as TableRoot } from "./Table.svelte";
3
+ const Table = TableRoot;
4
+ Table.TH = TH;
5
+ export * from "./types.js";
6
+ 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
+ }
@@ -0,0 +1,2 @@
1
+ import type { SvelteHTMLElements } from "svelte/elements";
2
+ export type TableProps = SvelteHTMLElements["table"];
@@ -0,0 +1,2 @@
1
+ /* @canonical/generator-ds 0.10.0-experimental.5 */
2
+ export {};
@@ -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;