@kickstartds/ds-agency-premium 1.6.71--canary.50.2218.0 → 1.6.71--canary.45.2226.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.
@@ -26,8 +26,22 @@ type ARIALabel = string;
26
26
  interface SearchResultProps {
27
27
  url?: URL;
28
28
  title?: Title;
29
+ previewImage?: PreviewImage;
29
30
  text?: Text;
30
31
  showLink?: ShowLink;
31
32
  ariaLabel?: ARIALabel;
32
33
  }
33
- export { URL, Title, Text, ShowLink, ARIALabel, SearchResultProps };
34
+ /**
35
+ * An optional preview image for the search result.
36
+ */
37
+ interface PreviewImage {
38
+ /**
39
+ * A URL to an image preview for the search result.
40
+ */
41
+ src?: string;
42
+ /**
43
+ * Large display of the preview image.
44
+ */
45
+ large?: boolean;
46
+ }
47
+ export { URL, Title, Text, ShowLink, ARIALabel, SearchResultProps, PreviewImage };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 03 Sep 2025 08:36:46 GMT
3
+ * Generated on Thu, 04 Sep 2025 08:25:20 GMT
4
4
  */
5
5
  :root, [ks-theme] {
6
6
  --ks-background-color-accent-base: var(--ks-color-fg-to-bg-9-base);
@@ -3936,17 +3936,17 @@
3936
3936
  "id": "corporate-search-result--default",
3937
3937
  "group": "Corporate / Search Result",
3938
3938
  "name": "Default",
3939
- "code": "<SearchResult\n ariaLabel=\"Search Result: AI Conference 2023\"\n link={{\n label: 'Read more',\n url: 'https://www.example.com/ai-conference-2023'\n }}\n showLink\n text=\"Join us for the annual **AI Conference** brings together experts from around the world\n[...] register now for the **AI Conference** to secure your spot\n[...] highlights from last year’s **AI Conference** included keynote speeches on machine learning\n[...] find out more about the **AI Conference** agenda and speakers\"\n title=\"AI Conference 2023\"\n url=\"https://www.example.com/ai-conference-2023\"\n/>",
3939
+ "code": "<SearchResult\n ariaLabel=\"Search Result: AI Conference 2023\"\n previewImage={{\n large: false,\n src: '/img/full-shot-different-people-working-together.png'\n }}\n showLink\n text=\"Join us for the annual **AI Conference** brings together experts from around the world\n[...] register now for the **AI Conference** to secure your spot\n[...] highlights from last year’s **AI Conference** included keynote speeches on machine learning\n[...] find out more about the **AI Conference** agenda and speakers\"\n title=\"AI Conference 2023\"\n url=\"https://www.example.com/ai-conference-2023\"\n/>",
3940
3940
  "args": {
3941
3941
  "url": "https://www.example.com/ai-conference-2023",
3942
3942
  "title": "AI Conference 2023",
3943
+ "previewImage": {
3944
+ "src": "/img/full-shot-different-people-working-together.png",
3945
+ "large": false
3946
+ },
3943
3947
  "text": "Join us for the annual **AI Conference** brings together experts from around the world\n[...] register now for the **AI Conference** to secure your spot\n[...] highlights from last year’s **AI Conference** included keynote speeches on machine learning\n[...] find out more about the **AI Conference** agenda and speakers",
3944
3948
  "showLink": true,
3945
- "ariaLabel": "Search Result: AI Conference 2023",
3946
- "link": {
3947
- "url": "https://www.example.com/ai-conference-2023",
3948
- "label": "Read more"
3949
- }
3949
+ "ariaLabel": "Search Result: AI Conference 2023"
3950
3950
  },
3951
3951
  "screenshot": "img/screenshots/corporate-search-result--default.png"
3952
3952
  },
@@ -8,7 +8,7 @@ import { FC, PropsWithChildren } from "react";
8
8
  import { HeadlineProps } from "../../HeadlineProps-e1305784.js";
9
9
  import { SearchBarProps } from "../../SearchBarProps-26263244.js";
10
10
  import { SearchFilterProps } from "../../SearchFilterProps-2fa6419b.js";
11
- import { SearchResultProps } from "../../SearchResultProps-224c2338.js";
11
+ import { SearchResultProps } from "../../SearchResultProps-5e57c4cb.js";
12
12
  interface SearchProps {
13
13
  /**
14
14
  * Referenced component HeadlineProps
@@ -16,6 +16,7 @@ import '@kickstartds/core/lib/component';
16
16
  import '../../helpers-12f48df8.js';
17
17
  import 'markdown-to-jsx';
18
18
  import '@kickstartds/base/lib/link';
19
+ import '@kickstartds/base/lib/picture';
19
20
  import '@kickstartds/base/lib/icon';
20
21
  import '@kickstartds/form/lib/text-field';
21
22
  import '@kickstartds/base/lib/headline';
@@ -227,6 +227,26 @@
227
227
  "AI Conference 2023"
228
228
  ]
229
229
  },
230
+ "previewImage": {
231
+ "title": "Preview Image",
232
+ "type": "object",
233
+ "description": "An optional preview image for the search result.",
234
+ "properties": {
235
+ "src": {
236
+ "type": "string",
237
+ "description": "A URL to an image preview for the search result.",
238
+ "examples": [
239
+ "/img/full-shot-different-people-working-together.png"
240
+ ]
241
+ },
242
+ "large": {
243
+ "type": "boolean",
244
+ "description": "Large display of the preview image.",
245
+ "default": false
246
+ }
247
+ },
248
+ "additionalProperties": false
249
+ },
230
250
  "text": {
231
251
  "title": "Text",
232
252
  "type": "string",
@@ -9,7 +9,7 @@ import { d as deepMergeDefaults } from '../../helpers-12f48df8.js';
9
9
 
10
10
  const defaults = {};
11
11
 
12
- const SearchBarContextDefault = forwardRef(({ placeholder, hint = "Press <kbd>Enter</kbd> to search", alternativeText = "Did you mean", alternativeResult = "AI Conference", }, ref) => (jsxs("div", { className: "dsa-search-bar", ref: ref, children: [jsxs("div", { className: "dsa-search-bar__input-container", children: [jsx(TextField, { hideLabel: true, type: "search", placeholder: placeholder || "Search...", className: "dsa-search-bar__input", autoComplete: "off" }), jsx(Icon, { icon: "search" })] }), hint && jsx(Markdown, { className: "dsa-search-bar__hint", children: hint }), alternativeResult && (jsx("p", { className: "dsa-search-bar__alternative-text", children: jsxs(Fragment, { children: [alternativeText + " ", jsx(Link, { href: "#", children: alternativeResult })] }) }))] })));
12
+ const SearchBarContextDefault = forwardRef(({ placeholder, hint = "Press <kbd>Enter</kbd> to search", alternativeText = "Did you mean", alternativeResult = "AI Conference", }, ref) => (jsxs("div", { className: "dsa-search-bar", ref: ref, children: [jsxs("div", { className: "dsa-search-bar__input-container", children: [jsx(TextField, { hideLabel: true, type: "search", placeholder: placeholder || "Search...", className: "dsa-search-bar__input" }), jsx(Icon, { icon: "search" })] }), hint && jsx(Markdown, { className: "dsa-search-bar__hint", children: hint }), alternativeResult && (jsx("p", { className: "dsa-search-bar__alternative-text", children: jsxs(Fragment, { children: [alternativeText + " ", jsx(Link, { href: "#", children: alternativeResult })] }) }))] })));
13
13
  const SearchBarContext = createContext(SearchBarContextDefault);
14
14
  const SearchBar = forwardRef((props, ref) => {
15
15
  const Component = useContext(SearchBarContext);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SearchResultProps } from "../../SearchResultProps-224c2338.js";
2
+ import { SearchResultProps } from "../../SearchResultProps-5e57c4cb.js";
3
3
  declare const SearchResultContextDefault: import("react").ForwardRefExoticComponent<SearchResultProps & import("react").RefAttributes<HTMLAnchorElement>>;
4
4
  declare const SearchResultContext: import("react").Context<import("react").ForwardRefExoticComponent<SearchResultProps & import("react").RefAttributes<HTMLAnchorElement>>>;
5
5
  declare const SearchResult: import("react").ForwardRefExoticComponent<SearchResultProps & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -4,12 +4,19 @@ import { forwardRef, createContext, useContext } from 'react';
4
4
  import { Link } from '@kickstartds/base/lib/link';
5
5
  import { RichText } from '@kickstartds/base/lib/rich-text';
6
6
  import { d as deepMergeDefaults } from '../../helpers-12f48df8.js';
7
+ import classnames from 'classnames';
8
+ import { Picture } from '@kickstartds/base/lib/picture';
7
9
 
8
10
  const defaults = {
11
+ "previewImage": {
12
+ "large": false
13
+ },
9
14
  "showLink": true
10
15
  };
11
16
 
12
- const SearchResultContextDefault = forwardRef(({ title, text, url, showLink, ariaLabel }, ref) => (jsxs(Link, { "aria-label": ariaLabel, href: url, className: "dsa-search-result", ref: ref, children: [jsx("span", { className: "dsa-search-result__title", children: title }), jsx(RichText, { text: text, className: "dsa-search-result__text" }), showLink && jsx("span", { className: "dsa-search-result__link", children: url })] })));
17
+ const SearchResultContextDefault = forwardRef(({ title, previewImage, text, url, showLink, ariaLabel }, ref) => (jsxs(Link, { "aria-label": ariaLabel, href: url, className: classnames("dsa-search-result", {
18
+ "dsa-search-result--image-large": previewImage?.large,
19
+ }), ref: ref, children: [previewImage && (jsx(Picture, { src: previewImage?.src, alt: "", className: "dsa-search-result__image" })), jsxs("div", { className: "dsa-search-result__content", children: [jsx("span", { className: "dsa-search-result__title", children: title }), jsx(RichText, { text: text, className: "dsa-search-result__text" }), showLink && jsx("span", { className: "dsa-search-result__link", children: url })] })] })));
13
20
  const SearchResultContext = createContext(SearchResultContextDefault);
14
21
  const SearchResult = forwardRef((props, ref) => {
15
22
  const Component = useContext(SearchResultContext);
@@ -3,15 +3,30 @@
3
3
  --g-link--text-decoration: none;
4
4
  --g-link--text-decoration-hover: none;
5
5
  display: flex;
6
- flex-direction: column;
7
- gap: var(--ks-spacing-stack-xs);
6
+ gap: var(--ks-spacing-inline-m);
8
7
  border: var(--ks-border-width-default) solid var(--ks-border-color-card-interactive);
9
8
  padding: var(--ks-spacing-inset-m);
10
9
  transition: var(--ks-transition-hover);
10
+ flex-wrap: wrap;
11
11
  }
12
12
  .dsa-search-result:hover {
13
13
  border-color: var(--ks-border-color-card-interactive-hover);
14
14
  }
15
+ .dsa-search-result--image-large .dsa-search-result__image {
16
+ max-width: var(--dsa-tile--width_medium);
17
+ }
18
+ .dsa-search-result__image {
19
+ flex-grow: 0;
20
+ max-width: var(--dsa-tile--width_small);
21
+ aspect-ratio: 4/3;
22
+ object-fit: cover;
23
+ }
24
+ .dsa-search-result__content {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: var(--ks-spacing-stack-xs);
28
+ flex-grow: 1;
29
+ }
15
30
  .dsa-search-result__title {
16
31
  font: var(--dsa-topic--font);
17
32
  color: var(--dsa-topic--color);
@@ -20,6 +20,26 @@
20
20
  "AI Conference 2023"
21
21
  ]
22
22
  },
23
+ "previewImage": {
24
+ "title": "Preview Image",
25
+ "type": "object",
26
+ "description": "An optional preview image for the search result.",
27
+ "properties": {
28
+ "src": {
29
+ "type": "string",
30
+ "description": "A URL to an image preview for the search result.",
31
+ "examples": [
32
+ "/img/full-shot-different-people-working-together.png"
33
+ ]
34
+ },
35
+ "large": {
36
+ "type": "boolean",
37
+ "description": "Large display of the preview image.",
38
+ "default": false
39
+ }
40
+ },
41
+ "additionalProperties": false
42
+ },
23
43
  "text": {
24
44
  "title": "Text",
25
45
  "type": "string",
@@ -16,6 +16,23 @@
16
16
  "description": "The title of the search result.",
17
17
  "examples": ["AI Conference 2023"]
18
18
  },
19
+ "previewImage": {
20
+ "title": "Preview Image",
21
+ "type": "object",
22
+ "description": "An optional preview image for the search result.",
23
+ "properties": {
24
+ "src": {
25
+ "type": "string",
26
+ "description": "A URL to an image preview for the search result.",
27
+ "examples": ["/img/full-shot-different-people-working-together.png"]
28
+ },
29
+ "large": {
30
+ "type": "boolean",
31
+ "description": "Large display of the preview image.",
32
+ "default": false
33
+ }
34
+ }
35
+ },
19
36
  "text": {
20
37
  "title": "Text",
21
38
  "type": "string",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 03 Sep 2025 08:36:48 GMT
3
+ * Generated on Thu, 04 Sep 2025 08:25:22 GMT
4
4
  */
5
5
  :root [ks-theme=business] {
6
6
  --ks-background-color-accent-base: var(--ks-color-primary-to-bg-8-base);
@@ -2727,7 +2727,7 @@
2727
2727
  }
2728
2728
  /**
2729
2729
  * Do not edit directly
2730
- * Generated on Wed, 03 Sep 2025 08:36:52 GMT
2730
+ * Generated on Thu, 04 Sep 2025 08:25:27 GMT
2731
2731
  */
2732
2732
  :root [ks-theme=google] {
2733
2733
  --ks-background-color-accent-base: var(--ks-color-primary-to-bg-8-base);
@@ -5458,7 +5458,7 @@
5458
5458
  }
5459
5459
  /**
5460
5460
  * Do not edit directly
5461
- * Generated on Wed, 03 Sep 2025 08:36:50 GMT
5461
+ * Generated on Thu, 04 Sep 2025 08:25:25 GMT
5462
5462
  */
5463
5463
  :root [ks-theme=ngo] {
5464
5464
  --ks-background-color-accent-base: var(--ks-color-primary-to-bg-8-base);
@@ -8459,7 +8459,7 @@
8459
8459
  }
8460
8460
  /**
8461
8461
  * Do not edit directly
8462
- * Generated on Wed, 03 Sep 2025 08:36:54 GMT
8462
+ * Generated on Thu, 04 Sep 2025 08:25:29 GMT
8463
8463
  */
8464
8464
  :root [ks-theme=telekom] {
8465
8465
  --ks-background-color-accent-base: var(--ks-color-primary-to-bg-8-base);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 03 Sep 2025 08:36:46 GMT
3
+ * Generated on Thu, 04 Sep 2025 08:25:20 GMT
4
4
  */
5
5
 
6
6
  :root, [ks-theme] {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 03 Sep 2025 08:36:47 GMT
3
+ * Generated on Thu, 04 Sep 2025 08:25:21 GMT
4
4
  */
5
5
 
6
6
  export const KsBackgroundColorAccentBase = "#f3f3f4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kickstartds/ds-agency-premium",
3
- "version": "1.6.71--canary.50.2218.0",
3
+ "version": "1.6.71--canary.45.2226.0",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kickstartDS/ds-agency-premium#readme",
6
6
  "bugs": {
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "scripts": {
42
42
  "build-storybook": "yarn build-tokens && yarn schema && yarn token && storybook build",
43
- "postbuild-storybook": "yarn search && yarn presets && yarn playroom:build && mkdir -p dist/components && cp snippets.json dist/components/presets.json",
43
+ "postbuild-storybook": "yarn presets && yarn playroom:build && mkdir -p dist/components && cp snippets.json dist/components/presets.json",
44
44
  "build-tokens-ds-agency": "kickstartDS tokens compile",
45
45
  "build-tokens-business": "kickstartDS tokens compile --token-dictionary-path src/token-business/dictionary --sd-config-path sd.config-business.cjs",
46
46
  "build-tokens-ngo": "kickstartDS tokens compile --token-dictionary-path src/token-ngo/dictionary --sd-config-path sd.config-ngo.cjs",
@@ -53,7 +53,6 @@
53
53
  "playroom:start": "playroom start",
54
54
  "playroom:build": "playroom build",
55
55
  "presets": "vitest run scripts/generatePresets.test.ts",
56
- "search": "rm -rf static/pagefind && vitest run scripts/generateSearchIndex.test.ts",
57
56
  "husky:precommit": "yarn schema && rollup -c",
58
57
  "prepare": "patch-package && husky install",
59
58
  "prepublishOnly": "rm -rf dist && yarn build-tokens && yarn schema && rollup -c && yarn build-storybook",
@@ -121,7 +120,6 @@
121
120
  "kickstartds": "3.5.0--canary.62.324.0",
122
121
  "lazysizes": "^5.3.2",
123
122
  "npm-run-all": "^4.1.5",
124
- "pagefind": "^1.4.0",
125
123
  "patch-package": "^8.0.0",
126
124
  "playroom": "^0.34.1",
127
125
  "postcss": "^8.4.29",
@@ -1,6 +0,0 @@
1
- declare class Search {
2
- static identifier: string;
3
- constructor(element: any);
4
- on(element: any, type: any, fn: any): () => any;
5
- }
6
- export { Search as default };
@@ -1,71 +0,0 @@
1
- import { define, Component } from '@kickstartds/core/lib/component';
2
-
3
- const staticPageFindPath = "/pagefind/pagefind.js";
4
- const parser = new DOMParser();
5
- class Search extends Component {
6
- constructor(element) {
7
- super(element);
8
- const input = element.querySelector(".dsa-search-bar__input");
9
- const template = element.querySelector(".dsa\\.search\\.result");
10
- const target = element.querySelector(".dsa\\.search\\.results");
11
- // TODO: Arrow Key Navigation
12
- const clearResults = () => {
13
- target.textContent = "";
14
- };
15
- const showResults = (results) => {
16
- for (const result of results) {
17
- const clone = template.cloneNode(true);
18
- clone.removeAttribute("hidden");
19
- clone.firstElementChild.setAttribute("href", result.url);
20
- if (result.title) {
21
- const title = clone.querySelector(".dsa-search-result__title");
22
- title.textContent = result.title;
23
- }
24
- if (result.excerpt) {
25
- const doc = parser.parseFromString(result.excerpt, "text/html");
26
- const excerpt = clone.querySelector(".dsa-search-result__text span");
27
- excerpt.replaceChildren(...doc.body.childNodes);
28
- }
29
- const link = clone.querySelector(".dsa-search-result__link");
30
- link.textContent = result.url;
31
- target.appendChild(clone);
32
- }
33
- };
34
- (async () => {
35
- const pagefind = await import(/* @vite-ignore */ staticPageFindPath);
36
- await pagefind.init();
37
- this.on(input, "input", async (event) => {
38
- if (!pagefind)
39
- return;
40
- if (input.value.length) {
41
- const search = await pagefind.debouncedSearch(input.value);
42
- if (search) {
43
- if (search.results.length) {
44
- // TODO: Pagination / Load More
45
- const results = await Promise.all(search.results.map((result) => result.data()));
46
- clearResults();
47
- showResults(results.map((result) => ({
48
- title: result.meta.title,
49
- url: result.url,
50
- excerpt: result.excerpt,
51
- })));
52
- }
53
- }
54
- }
55
- else {
56
- clearResults();
57
- }
58
- });
59
- })();
60
- }
61
- on(element, type, fn) {
62
- const cleanUp = () => element.removeventListener(type, fn);
63
- element.addEventListener(type, fn);
64
- this.onDisconnect(cleanUp);
65
- return cleanUp;
66
- }
67
- }
68
- Search.identifier = "dsa.search";
69
- define(Search.identifier, Search);
70
-
71
- export { Search as default };