@kickstartds/ds-agency-premium 1.6.71--canary.45.1821.0 → 1.6.71--canary.45.1833.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/SearchFilterProps-2fa6419b.d.ts +29 -0
- package/dist/SearchResultProps-224c2338.d.ts +33 -0
- package/dist/components/cta/cta.css +2 -2
- package/dist/components/event-registration/event-registration.css +17 -2
- package/dist/components/event-registration/index.js +1 -1
- package/dist/components/page-wrapper/index.js +8 -0
- package/dist/components/page-wrapper/tokens.css +1 -1
- package/dist/components/presets.json +227 -4
- package/dist/components/search/index.d.ts +19 -0
- package/dist/components/search/index.js +39 -0
- package/dist/components/search/search.schema.dereffed.json +134 -0
- package/dist/components/search/search.schema.json +18 -0
- package/dist/components/search-bar/index.d.ts +35 -0
- package/dist/components/search-bar/index.js +17 -0
- package/dist/components/search-bar/search-bar.css +33 -0
- package/dist/components/search-bar/search-bar.schema.dereffed.json +48 -0
- package/dist/components/search-bar/search-bar.schema.json +35 -0
- package/dist/components/search-filter/index.d.ts +7 -0
- package/dist/components/search-filter/index.js +15 -0
- package/dist/components/search-filter/search-filter.css +20 -0
- package/dist/components/search-filter/search-filter.schema.dereffed.json +69 -0
- package/dist/components/search-filter/search-filter.schema.json +46 -0
- package/dist/components/search-result/index.d.ts +7 -0
- package/dist/components/search-result/index.js +15 -0
- package/dist/components/search-result/search-result.css +26 -0
- package/dist/components/search-result/search-result.schema.dereffed.json +50 -0
- package/dist/components/search-result/search-result.schema.json +41 -0
- package/dist/global.css +1 -1
- package/dist/static/img/people/contact-person.png +0 -0
- package/dist/tokens/IconSprite.js +8 -0
- package/dist/tokens/icon-sprite.html +2 -0
- package/dist/tokens/themes.css +4 -4
- package/dist/tokens/tokens.css +1 -1
- package/dist/tokens/tokens.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/cms/search.schema.json",
|
|
4
|
+
"title": "Search",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"searchFilter": {
|
|
8
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
9
|
+
"$id": "http://schema.mydesignsystem.com/search-filter.schema.json",
|
|
10
|
+
"title": "Search Filter",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"title": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The title of the search filter.",
|
|
16
|
+
"examples": [
|
|
17
|
+
"Search by category"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"categories": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"description": "The categories to filter by.",
|
|
23
|
+
"examples": [
|
|
24
|
+
[
|
|
25
|
+
{
|
|
26
|
+
"title": "Pages",
|
|
27
|
+
"amount": "10"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"title": "News",
|
|
31
|
+
"amount": "5"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"title": "Blog Posts",
|
|
35
|
+
"amount": "8"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
],
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"title": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "The name of the category.",
|
|
45
|
+
"examples": [
|
|
46
|
+
"Pages",
|
|
47
|
+
"News"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"amount": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The number of items in the category.",
|
|
53
|
+
"examples": [
|
|
54
|
+
"10",
|
|
55
|
+
"5"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"url": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"format": "uri",
|
|
61
|
+
"description": "The URL to filter by this category.",
|
|
62
|
+
"examples": [
|
|
63
|
+
"#"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"type": {
|
|
71
|
+
"const": "search-filter"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
},
|
|
76
|
+
"searchResults": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": {
|
|
79
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
80
|
+
"$id": "http://schema.mydesignsystem.com/search-result.schema.json",
|
|
81
|
+
"title": "Search Result",
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"url": {
|
|
85
|
+
"title": "URL",
|
|
86
|
+
"type": "string",
|
|
87
|
+
"description": "A URL linking to the search result or more information.",
|
|
88
|
+
"examples": [
|
|
89
|
+
"https://www.example.com/ai-conference-2023"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"title": {
|
|
93
|
+
"title": "Title",
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "The title of the search result.",
|
|
96
|
+
"examples": [
|
|
97
|
+
"AI Conference 2023"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"text": {
|
|
101
|
+
"title": "Text",
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "The main content or description of the search result.",
|
|
104
|
+
"examples": [
|
|
105
|
+
"Join us for the AI Conference 2023, where industry leaders discuss the future of AI."
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"showLink": {
|
|
109
|
+
"title": "Show Link",
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"description": "Whether to display the link to the search result.",
|
|
112
|
+
"default": true
|
|
113
|
+
},
|
|
114
|
+
"ariaLabel": {
|
|
115
|
+
"title": "ARIA Label",
|
|
116
|
+
"type": "string",
|
|
117
|
+
"description": "An ARIA label for accessibility purposes.",
|
|
118
|
+
"examples": [
|
|
119
|
+
"Search result: Conference 2023"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"type": {
|
|
123
|
+
"const": "search-result"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"additionalProperties": false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"type": {
|
|
130
|
+
"const": "search"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"additionalProperties": false
|
|
134
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/cms/search.schema.json",
|
|
4
|
+
"title": "Search",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"searchFilter": {
|
|
8
|
+
"$ref": "http://schema.mydesignsystem.com/search-filter.schema.json"
|
|
9
|
+
},
|
|
10
|
+
"searchResults": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"$ref": "http://schema.mydesignsystem.com/search-result.schema.json"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
5
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
6
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Placeholder text for the search input field.
|
|
10
|
+
*/
|
|
11
|
+
type Placeholder = string;
|
|
12
|
+
interface SearchBarProps {
|
|
13
|
+
placeholder?: Placeholder;
|
|
14
|
+
/**
|
|
15
|
+
* Text displayed on the search button.
|
|
16
|
+
*/
|
|
17
|
+
buttonText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Additional information or instructions related to the search functionality.
|
|
20
|
+
*/
|
|
21
|
+
hint?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Text to display when offering alternative results.
|
|
24
|
+
*/
|
|
25
|
+
alternativeText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The alternative result to display when offering suggestions.
|
|
28
|
+
*/
|
|
29
|
+
alternativeResult?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const SearchBarContextDefault: import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const SearchBarContext: import("react").Context<import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
33
|
+
declare const SearchBar: import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export type { SearchBarProps };
|
|
35
|
+
export { SearchBarContextDefault, SearchBarContext, SearchBar };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./search-bar.css";
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, createContext, useContext } from 'react';
|
|
4
|
+
import { TextField } from '@kickstartds/form/lib/text-field';
|
|
5
|
+
import Markdown from 'markdown-to-jsx';
|
|
6
|
+
import { Icon } from '@kickstartds/base/lib/icon';
|
|
7
|
+
import { Link } from '@kickstartds/base/lib/link';
|
|
8
|
+
|
|
9
|
+
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 })] }) }))] })));
|
|
10
|
+
const SearchBarContext = createContext(SearchBarContextDefault);
|
|
11
|
+
const SearchBar = forwardRef((props, ref) => {
|
|
12
|
+
const Component = useContext(SearchBarContext);
|
|
13
|
+
return jsx(Component, { ...props, ref: ref });
|
|
14
|
+
});
|
|
15
|
+
SearchBar.displayName = "SearchBar";
|
|
16
|
+
|
|
17
|
+
export { SearchBar, SearchBarContext, SearchBarContextDefault };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.dsa-search-bar__input-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.dsa-search-bar__input-container .icon {
|
|
5
|
+
position: absolute;
|
|
6
|
+
left: var(--ks-spacing-inset-s);
|
|
7
|
+
top: 50%;
|
|
8
|
+
transform: translateY(-50%);
|
|
9
|
+
color: var(--ks-color-fg-alpha-6);
|
|
10
|
+
width: 1em;
|
|
11
|
+
height: 1em;
|
|
12
|
+
}
|
|
13
|
+
.dsa-search-bar__input.c-form-field__input {
|
|
14
|
+
padding: var(--ks-spacing-inset-xs);
|
|
15
|
+
font: var(--ks-font-interface-s);
|
|
16
|
+
padding-left: calc(var(--ks-spacing-inset-s) + 1em + var(--ks-spacing-xxs));
|
|
17
|
+
}
|
|
18
|
+
.dsa-search-bar__hint {
|
|
19
|
+
display: block;
|
|
20
|
+
font: var(--ks-font-interface-xs);
|
|
21
|
+
color: var(--ks-color-fg-alpha-4);
|
|
22
|
+
margin-top: var(--ks-spacing-stack-xs);
|
|
23
|
+
}
|
|
24
|
+
.dsa-search-bar__hint kbd {
|
|
25
|
+
font-size: 0.8em;
|
|
26
|
+
border-radius: 3px;
|
|
27
|
+
}
|
|
28
|
+
.dsa-search-bar__alternative-text {
|
|
29
|
+
margin-top: var(--ks-spacing-stack-s);
|
|
30
|
+
margin-bottom: 0;
|
|
31
|
+
font: var(--ks-font-interface-m);
|
|
32
|
+
color: var(--ks-text-color-interface);
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/search-bar.schema.json",
|
|
4
|
+
"title": "Search Bar",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"placeholder": {
|
|
8
|
+
"title": "Placeholder",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Placeholder text for the search input field.",
|
|
11
|
+
"examples": [
|
|
12
|
+
"Search..."
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"buttonText": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Text displayed on the search button.",
|
|
18
|
+
"examples": [
|
|
19
|
+
"Search"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"hint": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Additional information or instructions related to the search functionality.",
|
|
25
|
+
"examples": [
|
|
26
|
+
"Press <kbd>Enter</kbd> to search"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"alternativeText": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Text to display when offering alternative results.",
|
|
32
|
+
"examples": [
|
|
33
|
+
"Did you mean"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"alternativeResult": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The alternative result to display when offering suggestions.",
|
|
39
|
+
"examples": [
|
|
40
|
+
"AI Conference"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"type": {
|
|
44
|
+
"const": "search-bar"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/search-bar.schema.json",
|
|
4
|
+
"title": "Search Bar",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"placeholder": {
|
|
8
|
+
"title": "Placeholder",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Placeholder text for the search input field.",
|
|
11
|
+
"examples": ["Search..."]
|
|
12
|
+
},
|
|
13
|
+
"buttonText": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Text displayed on the search button.",
|
|
16
|
+
"examples": ["Search"]
|
|
17
|
+
},
|
|
18
|
+
"hint": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Additional information or instructions related to the search functionality.",
|
|
21
|
+
"examples": ["Press <kbd>Enter</kbd> to search"]
|
|
22
|
+
},
|
|
23
|
+
"alternativeText": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Text to display when offering alternative results.",
|
|
26
|
+
"examples": ["Did you mean"]
|
|
27
|
+
},
|
|
28
|
+
"alternativeResult": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The alternative result to display when offering suggestions.",
|
|
31
|
+
"examples": ["AI Conference"]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SearchFilterProps } from "../../SearchFilterProps-2fa6419b.js";
|
|
3
|
+
declare const SearchFilterContextDefault: import("react").ForwardRefExoticComponent<SearchFilterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const SearchFilterContext: import("react").Context<import("react").ForwardRefExoticComponent<SearchFilterProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
5
|
+
declare const SearchFilter: import("react").ForwardRefExoticComponent<SearchFilterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export type { SearchFilterProps };
|
|
7
|
+
export { SearchFilterContextDefault, SearchFilterContext, SearchFilter };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./search-filter.css";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, createContext, useContext } from 'react';
|
|
4
|
+
import Markdown from 'markdown-to-jsx';
|
|
5
|
+
import { Link } from '@kickstartds/base/lib/link';
|
|
6
|
+
|
|
7
|
+
const SearchFilterContextDefault = forwardRef(({ title, categories }, ref) => (jsxs("div", { className: "dsa-search-filter", ref: ref, children: [title && jsx(Markdown, { className: "dsa-search-filter__title", children: title }), jsx("div", { className: "dsa-search-filter__categories", children: categories.map((category, index) => (jsxs("div", { className: "dsa-search-filter__category", children: [jsx(Link, { href: category.url, className: "dsa-search-filter__category-title", children: category.title }), jsx("span", { className: "dsa-search-filter__category-amount", children: " (" + category.amount + ")" })] }, index))) })] })));
|
|
8
|
+
const SearchFilterContext = createContext(SearchFilterContextDefault);
|
|
9
|
+
const SearchFilter = forwardRef((props, ref) => {
|
|
10
|
+
const Component = useContext(SearchFilterContext);
|
|
11
|
+
return jsx(Component, { ...props, ref: ref });
|
|
12
|
+
});
|
|
13
|
+
SearchFilter.displayName = "SearchFilter";
|
|
14
|
+
|
|
15
|
+
export { SearchFilter, SearchFilterContext, SearchFilterContextDefault };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.dsa-search-filter {
|
|
2
|
+
background-color: var(--ks-background-color-accent);
|
|
3
|
+
border-radius: var(--ks-border-radius-card);
|
|
4
|
+
padding: var(--ks-spacing-inset-m);
|
|
5
|
+
}
|
|
6
|
+
.dsa-search-filter__title {
|
|
7
|
+
font: var(--dsa-topic--font);
|
|
8
|
+
color: var(--dsa-topic--color);
|
|
9
|
+
font-weight: var(--dsa-topic--font-weight);
|
|
10
|
+
}
|
|
11
|
+
.dsa-search-filter__categories {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: var(--ks-spacing-xxs);
|
|
15
|
+
margin-top: var(--ks-spacing-stack-s);
|
|
16
|
+
}
|
|
17
|
+
.dsa-search-filter__category {
|
|
18
|
+
font: var(--ks-font-interface-m);
|
|
19
|
+
color: var(--ks-text-color-interface);
|
|
20
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/search-filter.schema.json",
|
|
4
|
+
"title": "Search Filter",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"title": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The title of the search filter.",
|
|
10
|
+
"examples": [
|
|
11
|
+
"Search by category"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"categories": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"description": "The categories to filter by.",
|
|
17
|
+
"examples": [
|
|
18
|
+
[
|
|
19
|
+
{
|
|
20
|
+
"title": "Pages",
|
|
21
|
+
"amount": "10"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"title": "News",
|
|
25
|
+
"amount": "5"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"title": "Blog Posts",
|
|
29
|
+
"amount": "8"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
],
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"title": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The name of the category.",
|
|
39
|
+
"examples": [
|
|
40
|
+
"Pages",
|
|
41
|
+
"News"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"amount": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "The number of items in the category.",
|
|
47
|
+
"examples": [
|
|
48
|
+
"10",
|
|
49
|
+
"5"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"url": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"format": "uri",
|
|
55
|
+
"description": "The URL to filter by this category.",
|
|
56
|
+
"examples": [
|
|
57
|
+
"#"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"type": {
|
|
65
|
+
"const": "search-filter"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"additionalProperties": false
|
|
69
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/search-filter.schema.json",
|
|
4
|
+
"title": "Search Filter",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"title": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The title of the search filter.",
|
|
10
|
+
"examples": ["Search by category"]
|
|
11
|
+
},
|
|
12
|
+
"categories": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"description": "The categories to filter by.",
|
|
15
|
+
"examples": [
|
|
16
|
+
[
|
|
17
|
+
{ "title": "Pages", "amount": "10" },
|
|
18
|
+
{ "title": "News", "amount": "5" },
|
|
19
|
+
{ "title": "Blog Posts", "amount": "8" }
|
|
20
|
+
]
|
|
21
|
+
],
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"title": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The name of the category.",
|
|
28
|
+
"examples": ["Pages", "News"]
|
|
29
|
+
},
|
|
30
|
+
"amount": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "The number of items in the category.",
|
|
33
|
+
"examples": ["10", "5"]
|
|
34
|
+
},
|
|
35
|
+
"url": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"format": "uri",
|
|
38
|
+
"description": "The URL to filter by this category.",
|
|
39
|
+
"examples": ["#"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SearchResultProps } from "../../SearchResultProps-224c2338.js";
|
|
3
|
+
declare const SearchResultContextDefault: import("react").ForwardRefExoticComponent<SearchResultProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
4
|
+
declare const SearchResultContext: import("react").Context<import("react").ForwardRefExoticComponent<SearchResultProps & import("react").RefAttributes<HTMLAnchorElement>>>;
|
|
5
|
+
declare const SearchResult: import("react").ForwardRefExoticComponent<SearchResultProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
6
|
+
export type { SearchResultProps };
|
|
7
|
+
export { SearchResultContextDefault, SearchResultContext, SearchResult };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./search-result.css";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, createContext, useContext } from 'react';
|
|
4
|
+
import { Link } from '@kickstartds/base/lib/link';
|
|
5
|
+
import { RichText } from '@kickstartds/base/lib/rich-text';
|
|
6
|
+
|
|
7
|
+
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 })] })));
|
|
8
|
+
const SearchResultContext = createContext(SearchResultContextDefault);
|
|
9
|
+
const SearchResult = forwardRef((props, ref) => {
|
|
10
|
+
const Component = useContext(SearchResultContext);
|
|
11
|
+
return jsx(Component, { ...props, ref: ref });
|
|
12
|
+
});
|
|
13
|
+
SearchResult.displayName = "SearchResult";
|
|
14
|
+
|
|
15
|
+
export { SearchResult, SearchResultContext, SearchResultContextDefault };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.dsa-search-result {
|
|
2
|
+
--g-link--border-radius: var(--ks-border-radius-card);
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--ks-spacing-stack-xs);
|
|
6
|
+
border: var(--ks-border-width-default) solid var(--ks-border-color-card-interactive);
|
|
7
|
+
padding: var(--ks-spacing-inset-m);
|
|
8
|
+
transition: var(--ks-transition-hover);
|
|
9
|
+
}
|
|
10
|
+
.dsa-search-result:hover {
|
|
11
|
+
border-color: var(--ks-border-color-card-interactive-hover);
|
|
12
|
+
}
|
|
13
|
+
.dsa-search-result__title {
|
|
14
|
+
font: var(--dsa-topic--font);
|
|
15
|
+
color: var(--dsa-topic--color);
|
|
16
|
+
font-weight: var(--dsa-topic--font-weight);
|
|
17
|
+
}
|
|
18
|
+
.dsa-search-result__link {
|
|
19
|
+
width: fit-content;
|
|
20
|
+
font: var(--ks-font-interface-s);
|
|
21
|
+
color: var(--dsa-link--color);
|
|
22
|
+
transition: inherit;
|
|
23
|
+
}
|
|
24
|
+
.dsa-search-result__link:hover {
|
|
25
|
+
color: var(--dsa-link--color_hover);
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/search-result.schema.json",
|
|
4
|
+
"title": "Search Result",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"url": {
|
|
8
|
+
"title": "URL",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "A URL linking to the search result or more information.",
|
|
11
|
+
"examples": [
|
|
12
|
+
"https://www.example.com/ai-conference-2023"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"title": {
|
|
16
|
+
"title": "Title",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The title of the search result.",
|
|
19
|
+
"examples": [
|
|
20
|
+
"AI Conference 2023"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"text": {
|
|
24
|
+
"title": "Text",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The main content or description of the search result.",
|
|
27
|
+
"examples": [
|
|
28
|
+
"Join us for the AI Conference 2023, where industry leaders discuss the future of AI."
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"showLink": {
|
|
32
|
+
"title": "Show Link",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "Whether to display the link to the search result.",
|
|
35
|
+
"default": true
|
|
36
|
+
},
|
|
37
|
+
"ariaLabel": {
|
|
38
|
+
"title": "ARIA Label",
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "An ARIA label for accessibility purposes.",
|
|
41
|
+
"examples": [
|
|
42
|
+
"Search result: Conference 2023"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"type": {
|
|
46
|
+
"const": "search-result"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"additionalProperties": false
|
|
50
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://schema.mydesignsystem.com/search-result.schema.json",
|
|
4
|
+
"title": "Search Result",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"url": {
|
|
8
|
+
"title": "URL",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "A URL linking to the search result or more information.",
|
|
11
|
+
"examples": ["https://www.example.com/ai-conference-2023"]
|
|
12
|
+
},
|
|
13
|
+
"title": {
|
|
14
|
+
"title": "Title",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The title of the search result.",
|
|
17
|
+
"examples": ["AI Conference 2023"]
|
|
18
|
+
},
|
|
19
|
+
"text": {
|
|
20
|
+
"title": "Text",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The main content or description of the search result.",
|
|
23
|
+
"examples": [
|
|
24
|
+
"Join us for the AI Conference 2023, where industry leaders discuss the future of AI."
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"showLink": {
|
|
28
|
+
"title": "Show Link",
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Whether to display the link to the search result.",
|
|
31
|
+
"default": true
|
|
32
|
+
},
|
|
33
|
+
"ariaLabel": {
|
|
34
|
+
"title": "ARIA Label",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "An ARIA label for accessibility purposes.",
|
|
37
|
+
"examples": ["Search result: Conference 2023"]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
}
|
package/dist/global.css
CHANGED
|
@@ -348,7 +348,7 @@ h3 {
|
|
|
348
348
|
[ks-inverted=true] {
|
|
349
349
|
--spacing-base: 18px;
|
|
350
350
|
--spacing-shrink-factor: 0.65;
|
|
351
|
-
--spacing-grow-factor: 1.
|
|
351
|
+
--spacing-grow-factor: 1.3;
|
|
352
352
|
--spacing-bp-factor: 1.0135;
|
|
353
353
|
--spacing-xxs-bp-factor: calc(1 * var(--spacing-bp-factor));
|
|
354
354
|
--spacing-xs-bp-factor: calc(var(--spacing-xxs-bp-factor) * var(--spacing-bp-factor));
|
|
Binary file
|
|
@@ -42,6 +42,14 @@ export default (() => /*#__PURE__*/_jsxs("svg", {
|
|
|
42
42
|
children: /*#__PURE__*/_jsx("path", {
|
|
43
43
|
d: "M13.4 12L18.7 6.7C19.1 6.3 19.1 5.7 18.7 5.3C18.3 4.9 17.7 4.9 17.3 5.3L12 10.6L6.7 5.3C6.3 4.9 5.7 4.9 5.3 5.3C4.9 5.7 4.9 6.3 5.3 6.7L10.6 12L5.3 17.3C4.9 17.7 4.9 18.3 5.3 18.7C5.5 18.9 5.7 19 6 19C6.3 19 6.5 18.9 6.7 18.7L12 13.4L17.3 18.7C17.5 18.9 17.8 19 18 19C18.2 19 18.5 18.9 18.7 18.7C19.1 18.3 19.1 17.7 18.7 17.3L13.4 12Z"
|
|
44
44
|
})
|
|
45
|
+
}), /*#__PURE__*/_jsx("symbol", {
|
|
46
|
+
id: "icon-search",
|
|
47
|
+
viewBox: "0 0 24 24",
|
|
48
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
49
|
+
fillRule: "evenodd",
|
|
50
|
+
clipRule: "evenodd",
|
|
51
|
+
d: "M11 2C15.9706 2 20 6.02944 20 11C20 13.125 19.2618 15.0766 18.0303 16.6162L21.707 20.293C22.0972 20.6835 22.0974 21.3166 21.707 21.707C21.3166 22.0974 20.6835 22.0972 20.293 21.707L16.6162 18.0303C15.0766 19.2618 13.125 20 11 20C6.02944 20 2 15.9706 2 11C2 6.02944 6.02944 2 11 2ZM11 4C7.13401 4 4 7.13401 4 11C4 14.866 7.13401 18 11 18C12.89 18 14.6038 17.2497 15.8633 16.0322C15.8877 16.0012 15.9148 15.9719 15.9434 15.9434C15.9719 15.9148 16.0012 15.8877 16.0322 15.8633C17.2497 14.6038 18 12.89 18 11C18 7.13401 14.866 4 11 4Z"
|
|
52
|
+
})
|
|
45
53
|
}), /*#__PURE__*/_jsxs("symbol", {
|
|
46
54
|
id: "icon-skip-back",
|
|
47
55
|
viewBox: "0 0 24 24",
|