@canonical/svelte-ds-app-launchpad 0.43.0 → 0.44.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 CHANGED
@@ -15,12 +15,6 @@ Import the main styles in your project's layout file (e.g. `routes/+layout.svelt
15
15
  ```svelte
16
16
  <script lang="ts">
17
17
  import "@canonical/svelte-ds-app-launchpad/styles.css";
18
-
19
- import "@canonical/launchpad-design-tokens/dist/css/dimension/responsive.css";
20
- import "@canonical/launchpad-design-tokens/dist/css/typography/responsive.css";
21
- import "@canonical/launchpad-design-tokens/dist/css/opacity/opacity.css";
22
- import "@canonical/launchpad-design-tokens/dist/css/transition/preferred.css";
23
- import "@canonical/launchpad-design-tokens/dist/css/color/light.css"; // dark.css or system.css
24
18
  </script>
25
19
  ```
26
20
 
package/dist/Welcome.mdx CHANGED
@@ -11,10 +11,10 @@ import { PackageInfo } from "@canonical/storybook-helpers";
11
11
  tier="apps"
12
12
  framework="svelte"
13
13
  status="prerelease"
14
- dependencies={["@canonical/launchpad-design-tokens", "@floating-ui/dom"]}
14
+ dependencies={["@floating-ui/dom"]}
15
15
  links={{
16
16
  source:
17
- "https://github.com/canonical/pragma/tree/main/packages/svelte/ds-app-launchpad",
18
- ontology: "https://github.com/canonical/design-system",
17
+ "https://github.com/canonical/pragma-web/tree/main/packages/svelte/ds-app-launchpad",
18
+ ontology: "https://github.com/canonical/pragma-core/tree/main/packages/semantics/design-system",
19
19
  }}
20
20
  />
@@ -1,5 +1,5 @@
1
- import type { Segment } from "../../../types.js";
2
- export type ItemProps = Segment & {
1
+ import type { BreadcrumbsSegment } from "../../../types.js";
2
+ export type ItemProps = BreadcrumbsSegment & {
3
3
  /** Indicates whether this segment represents the current page */
4
4
  current?: boolean;
5
5
  };
@@ -1,2 +1,2 @@
1
1
  export { default as Breadcrumbs } from "./Breadcrumbs.svelte";
2
- export type { BreadcrumbsProps, Segment } from "./types.js";
2
+ export type { BreadcrumbsProps, BreadcrumbsSegment } from "./types.js";
@@ -8,12 +8,12 @@ type TextSegment = Omit<SvelteHTMLElements["span"], "children"> & {
8
8
  label: string;
9
9
  href?: never;
10
10
  };
11
- export type Segment = LinkSegment | TextSegment;
11
+ export type BreadcrumbsSegment = LinkSegment | TextSegment;
12
12
  export interface BreadcrumbsProps extends Omit<SvelteHTMLElements["nav"], "children"> {
13
13
  /**
14
14
  * Breadcrumb segments.
15
15
  */
16
- segments: Segment[];
16
+ segments: BreadcrumbsSegment[];
17
17
  /**
18
18
  * The number of segments, from the end, that should never be collapsed.
19
19
  * If set to `all` or a number greater or equal to the total number of segments, no segments will be collapsed.
@@ -22,7 +22,7 @@ export interface BreadcrumbsProps extends Omit<SvelteHTMLElements["nav"], "child
22
22
  */
23
23
  minNumExpanded?: "all" | number;
24
24
  }
25
- export type PossiblyCollapsedSegment = Segment & {
25
+ export type PossiblyCollapsedSegment = BreadcrumbsSegment & {
26
26
  collapsed?: boolean;
27
27
  };
28
28
  export {};
@@ -45,6 +45,10 @@
45
45
  display: inline-flex;
46
46
  justify-content: center;
47
47
 
48
+ &:focus-visible {
49
+ outline-color: var(--color-focusRing);
50
+ }
51
+
48
52
  &:disabled,
49
53
  &[aria-disabled="true"] {
50
54
  color: var(--modifier-color-text-disabled, var(--disabled--color-text));
@@ -4,7 +4,7 @@
4
4
  appearance: none;
5
5
  flex-grow: 0;
6
6
  flex-shrink: 0;
7
- outline-offset: 1px;
7
+ outline-offset: var(--dimension-stroke-thickness-medium);
8
8
 
9
9
  width: var(--dimension-200);
10
10
  height: var(--dimension-200);
@@ -17,7 +17,7 @@
17
17
  );
18
18
  --color-border-input: var(--modifier-color-border, var(--color-border));
19
19
  --color-outline-input: var(
20
- --modifier-color-focusRing,
20
+ --modifier-color-focus-ring,
21
21
  var(--color-focusRing)
22
22
  );
23
23
  }
@@ -4,7 +4,7 @@
4
4
  appearance: none;
5
5
  flex-grow: 0;
6
6
  flex-shrink: 0;
7
- outline-offset: 1px;
7
+ outline-offset: var(--dimension-stroke-thickness-medium);
8
8
 
9
9
  width: var(--dimension-200);
10
10
  height: var(--dimension-200);
@@ -21,7 +21,7 @@
21
21
  var(--color-border)
22
22
  );
23
23
  --color-outline-select-input: var(
24
- --modifier-color-focusRing,
24
+ --modifier-color-focus-ring,
25
25
  var(--color-focusRing)
26
26
  );
27
27
 
@@ -2,7 +2,7 @@
2
2
  appearance: none;
3
3
  position: relative;
4
4
  cursor: pointer;
5
- outline-offset: 0;
5
+ outline-offset: var(--dimension-stroke-thickness-medium);
6
6
 
7
7
  width: var(--dimension-400);
8
8
  height: var(--dimension-200);
@@ -17,7 +17,7 @@
17
17
  );
18
18
  --color-border-input: var(--modifier-color-border, var(--color-border));
19
19
  --color-outline-input: var(
20
- --modifier-color-focusRing,
20
+ --modifier-color-focus-ring,
21
21
  var(--color-focusRing)
22
22
  );
23
23
  }
package/dist/index.css CHANGED
@@ -2,4 +2,3 @@
2
2
  @import "./styles/ds-tokens.css";
3
3
  @import "./styles/ds-shim.css";
4
4
  @import "./styles/index.css";
5
- @import "./modifier-families/styles/index.css";
@@ -3,6 +3,5 @@ export declare const MODIFIER_FAMILIES: {
3
3
  readonly anticipation: readonly ["constructive", "destructive", "caution"];
4
4
  readonly importance: readonly ["primary", "secondary", "tertiary"];
5
5
  readonly emphasis: readonly ["muted", "branded"];
6
- readonly severity: readonly ["neutral", "positive", "negative", "caution", "information"];
7
6
  readonly density: readonly ["dense", "compact", "comfortable"];
8
7
  };
@@ -3,8 +3,6 @@ export const MODIFIER_FAMILIES = {
3
3
  anticipation: ["constructive", "destructive", "caution"],
4
4
  importance: ["primary", "secondary", "tertiary"],
5
5
  emphasis: ["muted", "branded"],
6
- // TODO: old modifier family. Remove severity after its no longer used
7
- severity: ["neutral", "positive", "negative", "caution", "information"],
8
6
  // compact is launchpad-only; the global density family is comfortable/dense
9
7
  density: ["dense", "compact", "comfortable"],
10
8
  };
@@ -8,16 +8,16 @@ export type ModifierFamilyValues = {
8
8
  *
9
9
  * @example
10
10
  * ```ts
11
- * type Severity = ModifierFamily<'severity'>;
11
+ * type Severity = ModifierFamily<'criticality'>;
12
12
  * // =>
13
13
  * type Severity = {
14
- * severity: 'neutral' | 'positive' | 'negative' | 'caution' | 'information'
14
+ * criticality: 'success' | 'error' | 'warning' | 'information'
15
15
  * }
16
16
  *
17
- * type Modifiers = ModifierFamily<['severity', 'emphasis']>;
17
+ * type Modifiers = ModifierFamily<['criticality', 'emphasis']>;
18
18
  * // =>
19
19
  * type Modifiers = {
20
- * severity: 'neutral' | 'positive' | 'negative' | 'caution' | 'information'
20
+ * criticality: 'success' | 'error' | 'warning' | 'information'
21
21
  * emphasis: 'neutral' | 'highlighted' | 'muted' | 'accented'
22
22
  * }
23
23
  * ```
@@ -2,6 +2,7 @@
2
2
  --ds-transition-duration-fast: 165ms;
3
3
  --ds-transition-duration-brisk: 333ms;
4
4
  --ds-transition-duration-snap: 100ms;
5
+ --ds-transition-duration-slow: 0.4s;
5
6
  --ds-transition-duration-sleepy: 1s;
6
7
  --ds-transition-timing-ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19);
7
8
  --ds-transition-timing-ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
@@ -44,6 +45,21 @@
44
45
  var(--typography-text-tertiary-bold-font-size) /
45
46
  var(--typography-text-tertiary-bold-line-height)
46
47
  var(--typography-text-tertiary-bold-font-family);
48
+ --ds-typography-heading-1:
49
+ var(--typography-heading-1-font-weight)
50
+ var(--typography-heading-1-font-size) /
51
+ var(--typography-heading-1-line-height)
52
+ var(--typography-heading-1-font-family);
53
+ --ds-typography-heading-2:
54
+ var(--typography-heading-2-font-weight)
55
+ var(--typography-heading-2-font-size) /
56
+ var(--typography-heading-2-line-height)
57
+ var(--typography-heading-2-font-family);
58
+ --ds-typography-heading-3:
59
+ var(--typography-heading-3-font-weight)
60
+ var(--typography-heading-3-font-size) /
61
+ var(--typography-heading-3-line-height)
62
+ var(--typography-heading-3-font-family);
47
63
  --ds-typography-heading-4:
48
64
  var(--typography-heading-4-font-weight)
49
65
  var(--typography-heading-4-font-size) /
@@ -54,6 +70,11 @@
54
70
  var(--typography-heading-5-font-size) /
55
71
  var(--typography-heading-5-line-height)
56
72
  var(--typography-heading-5-font-family);
73
+ --ds-typography-heading-6:
74
+ var(--typography-heading-6-font-weight)
75
+ var(--typography-heading-6-font-size) /
76
+ var(--typography-heading-6-line-height)
77
+ var(--typography-heading-6-font-family);
57
78
  }
58
79
 
59
80
  @layer ds.modifiers {
@@ -66,48 +87,6 @@
66
87
  }
67
88
  }
68
89
 
69
- /* The criticality modifier exposes every color channel except the solid fill
70
- * and the on-surface text pairing, so a component painting a solid criticality
71
- * surface has nothing to read.
72
- * Upstream fix: https://github.com/canonical/design-tokens/pull/104
73
- * Delete each line once its channel is generated upstream and the
74
- * design-tokens pin is bumped. */
75
- @layer ds.modifiers {
76
- .success {
77
- --modifier-color-foreground-primary: var(
78
- --color-foreground-primary-success
79
- );
80
- --modifier-color-text-onForegroundSecondary: var(
81
- --color-text-onForegroundSecondary-success
82
- );
83
- }
84
-
85
- .error {
86
- --modifier-color-foreground-primary: var(--color-foreground-primary-error);
87
- --modifier-color-text-onForegroundSecondary: var(
88
- --color-text-onForegroundSecondary-error
89
- );
90
- }
91
-
92
- .warning {
93
- --modifier-color-foreground-primary: var(
94
- --color-foreground-primary-warning
95
- );
96
- --modifier-color-text-onForegroundSecondary: var(
97
- --color-text-onForegroundSecondary-warning
98
- );
99
- }
100
-
101
- .information {
102
- --modifier-color-foreground-primary: var(
103
- --color-foreground-primary-information
104
- );
105
- --modifier-color-text-onForegroundSecondary: var(
106
- --color-text-onForegroundSecondary-information
107
- );
108
- }
109
- }
110
-
111
90
  @media (prefers-reduced-motion: reduce) {
112
91
  :root {
113
92
  --ds-transition-duration-fast: 0ms;
@@ -2,32 +2,18 @@
2
2
  @import "./font-faces.css";
3
3
 
4
4
  html {
5
- color: var(--lp-color-text-default);
6
- background-color: var(--lp-color-background-default);
7
-
8
- /*
9
- TODO: Should the color be controlled on the level of modifiers (severity)? If so, how?
10
- Outline colors, according to vanilla should:
11
- - on `Chip` stay default no matter the modifier,
12
- - OK, we just don't subscribe to the context at all;
13
- - on `TextInput` follow the values of the secondary context,
14
- - OK, we subscribe to the secondary context;
15
- - on `Button` stay default for all severities but `positive`, where it should become a very dark green,
16
- - not OK, we don't have the required value in the severity context.
17
- */
18
- --focus-outline: var(--lp-dimension-stroke-thickness-large) solid
19
- var(--lp-color-border-focus);
20
- /* Most elements have the outline on the inside of the element. Needs to be adjusted for specific cases (e.g. checkbox, radio) */
21
- --focus-outline-offset: calc(var(--lp-dimension-stroke-thickness-large) * -1);
5
+ color: var(--color-text);
6
+ background-color: var(--color-background);
22
7
  }
23
8
 
24
9
  body {
25
- font: var(--lp-typography-paragraph-s);
10
+ font: var(--ds-typography-text-primary);
26
11
  }
27
12
 
28
13
  *:focus-visible {
29
- outline: var(--focus-outline);
30
- outline-offset: var(--focus-outline-offset);
14
+ outline: var(--dimension-stroke-thickness-large) solid
15
+ var(--modifier-color-focus-ring, var(--color-focusRing));
16
+ outline-offset: calc(var(--dimension-stroke-thickness-large) * -1);
31
17
  }
32
18
 
33
19
  .visually-hidden {
@@ -51,20 +37,20 @@ body {
51
37
  }
52
38
 
53
39
  h1 {
54
- font: var(--lp-typography-h1);
40
+ font: var(--ds-typography-heading-1);
55
41
  }
56
42
  h2 {
57
- font: var(--lp-typography-h2);
43
+ font: var(--ds-typography-heading-2);
58
44
  }
59
45
  h3 {
60
- font: var(--lp-typography-h3);
46
+ font: var(--ds-typography-heading-3);
61
47
  }
62
48
  h4 {
63
- font: var(--lp-typography-h4);
49
+ font: var(--ds-typography-heading-4);
64
50
  }
65
51
  h5 {
66
- font: var(--lp-typography-h5);
52
+ font: var(--ds-typography-heading-5);
67
53
  }
68
54
  h6 {
69
- font: var(--lp-typography-h6);
55
+ font: var(--ds-typography-heading-6);
70
56
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canonical/svelte-ds-app-launchpad",
3
3
  "description": "Launchpad-specific components for the Pragma design system.",
4
- "version": "0.43.0",
4
+ "version": "0.44.1",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -62,16 +62,16 @@
62
62
  "storybook": "storybook dev -p 6008 --no-open --host 0.0.0.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@biomejs/biome": "2.5.14",
65
+ "@biomejs/biome": "2.5.15",
66
66
  "@canonical/biome-config": "0.43.0",
67
- "@canonical/storybook-config": "^0.43.0",
68
- "@canonical/storybook-helpers": "^0.43.0",
69
- "@canonical/svelte-ssr-test": "^0.43.0",
70
- "@canonical/typescript-config-svelte": "^0.43.0",
67
+ "@canonical/storybook-config": "^0.44.1",
68
+ "@canonical/storybook-helpers": "^0.44.1",
69
+ "@canonical/svelte-ssr-test": "^0.44.1",
70
+ "@canonical/typescript-config-svelte": "^0.44.1",
71
71
  "@canonical/webarchitect": "0.43.0",
72
72
  "@storybook/addon-docs": "^10.6.0",
73
73
  "@storybook/addon-svelte-csf": "^5.1.3",
74
- "@sveltejs/package": "3.0.0-next.8",
74
+ "@sveltejs/package": "3.0.0",
75
75
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
76
76
  "@types/bun": "^1.3.10",
77
77
  "@vitest/browser": "^5.0.0",
@@ -82,17 +82,16 @@
82
82
  "typescript": "~6.0.3",
83
83
  "vite": "^8.0.0",
84
84
  "vitest": "^5.0.0",
85
- "vitest-browser-svelte": "^2.0.2"
85
+ "vitest-browser-svelte": "^3.0.0"
86
86
  },
87
87
  "dependencies": {
88
88
  "@canonical/design-tokens": "0.43.0",
89
- "@canonical/launchpad-design-tokens": "^1.1.1",
90
- "@canonical/styles": "^0.43.0",
89
+ "@canonical/styles": "^0.44.1",
91
90
  "@canonical/svelte-icons": "^0.0.9",
92
91
  "@floating-ui/dom": "^1.7.6"
93
92
  },
94
93
  "peerDependencies": {
95
94
  "svelte": "^5.47.1"
96
95
  },
97
- "gitHead": "581682464ef71de3f77dc2dc8bbe2b7e493bb05e"
96
+ "gitHead": "81ed283dd7509fb5de86dfe39021c62de3e31b5e"
98
97
  }
@@ -1,14 +0,0 @@
1
- .dense {
2
- --lp-dimension-padding-block-context: var(
3
- --lp-dimension-spacing-block-minimum
4
- );
5
- --lp-dimension-padding-inline-context: var(--lp-dimension-spacing-inline-s);
6
- }
7
-
8
- .compact {
9
- --lp-dimension-padding-block-context: var(
10
- --lp-dimension-spacing-block-minimum
11
- );
12
- --lp-dimension-padding-inline-context: var(--lp-dimension-spacing-inline-xs);
13
- --lp-typography-context: var(--lp-typography-paragraph-s);
14
- }
@@ -1,2 +0,0 @@
1
- @import "./density.css";
2
- @import "./severity.css";
@@ -1,87 +0,0 @@
1
- .positive {
2
- --lp-color-border-context: var(--lp-color-fill-positive-default);
3
- --lp-color-border-hover-context: var(--lp-color-fill-positive-hover);
4
- --lp-color-border-active-context: var(--lp-color-fill-positive-active);
5
- --lp-color-text-context: var(--lp-color-text-white);
6
- --lp-color-background-context: var(--lp-color-fill-positive-default);
7
- --lp-color-background-hover-context: var(--lp-color-fill-positive-hover);
8
- --lp-color-background-active-context: var(--lp-color-fill-positive-active);
9
-
10
- --lp-color-border-secondary-context: var(--lp-color-border-positive);
11
- --lp-color-text-secondary-context: var(--lp-color-text-default);
12
- --lp-color-background-secondary-context: var(
13
- --lp-color-background-positive-default
14
- );
15
- --lp-color-background-secondary-hover-context: var(
16
- --lp-color-background-positive-hover
17
- );
18
- --lp-color-background-secondary-active-context: var(
19
- --lp-color-background-positive-active
20
- );
21
- }
22
-
23
- .negative {
24
- --lp-color-border-context: var(--lp-color-fill-negative-default);
25
- --lp-color-border-hover-context: var(--lp-color-fill-negative-hover);
26
- --lp-color-border-active-context: var(--lp-color-fill-negative-active);
27
- --lp-color-text-context: var(--lp-color-text-white);
28
- --lp-color-background-context: var(--lp-color-fill-negative-default);
29
- --lp-color-background-hover-context: var(--lp-color-fill-negative-hover);
30
- --lp-color-background-active-context: var(--lp-color-fill-negative-active);
31
-
32
- --lp-color-border-secondary-context: var(--lp-color-border-negative);
33
- --lp-color-text-secondary-context: var(--lp-color-text-default);
34
- --lp-color-background-secondary-context: var(
35
- --lp-color-background-negative-default
36
- );
37
- --lp-color-background-secondary-hover-context: var(
38
- --lp-color-background-negative-hover
39
- );
40
- --lp-color-background-secondary-active-context: var(
41
- --lp-color-background-negative-active
42
- );
43
- }
44
-
45
- .caution {
46
- --lp-color-border-context: var(--lp-color-status-caution);
47
- --lp-color-border-hover-context: var(--lp-color-status-caution);
48
- --lp-color-border-active-context: var(--lp-color-status-caution);
49
- --lp-color-text-context: var(--lp-color-text-white);
50
- --lp-color-background-context: var(--lp-color-status-caution);
51
- --lp-color-background-hover-context: var(--lp-color-status-caution);
52
- --lp-color-background-active-context: var(--lp-color-status-caution);
53
-
54
- --lp-color-border-secondary-context: var(--lp-color-border-caution);
55
- --lp-color-text-secondary-context: var(--lp-color-text-default);
56
- --lp-color-background-secondary-context: var(
57
- --lp-color-background-caution-default
58
- );
59
- --lp-color-background-secondary-hover-context: var(
60
- --lp-color-background-caution-hover
61
- );
62
- --lp-color-background-secondary-active-context: var(
63
- --lp-color-background-caution-active
64
- );
65
- }
66
-
67
- .information {
68
- --lp-color-border-context: var(--lp-color-status-information);
69
- --lp-color-border-hover-context: var(--lp-color-status-information);
70
- --lp-color-border-active-context: var(--lp-color-status-information);
71
- --lp-color-text-context: var(--lp-color-text-white);
72
- --lp-color-background-context: var(--lp-color-status-information);
73
- --lp-color-background-hover-context: var(--lp-color-status-information);
74
- --lp-color-background-active-context: var(--lp-color-status-information);
75
-
76
- --lp-color-border-secondary-context: var(--lp-color-border-information);
77
- --lp-color-text-secondary-context: var(--lp-color-text-default);
78
- --lp-color-background-secondary-context: var(
79
- --lp-color-background-information-default
80
- );
81
- --lp-color-background-secondary-hover-context: var(
82
- --lp-color-background-information-hover
83
- );
84
- --lp-color-background-secondary-active-context: var(
85
- --lp-color-background-information-active
86
- );
87
- }