@kaizen/components 1.49.3 → 1.51.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/cjs/Filter/FilterMultiSelect/subcomponents/SearchInput/SearchInput.cjs +14 -2
- package/dist/cjs/Input/InputSearch/InputSearch.cjs +8 -1
- package/dist/cjs/TitleBlockZen/TitleBlockZen.cjs +1 -1
- package/dist/esm/Filter/FilterMultiSelect/subcomponents/SearchInput/SearchInput.mjs +14 -2
- package/dist/esm/Input/InputSearch/InputSearch.mjs +8 -1
- package/dist/esm/TitleBlockZen/TitleBlockZen.mjs +1 -1
- package/dist/styles.css +4 -4
- package/locales/ar.json +12 -0
- package/locales/bg.json +12 -0
- package/locales/cs.json +12 -0
- package/locales/cy.json +12 -0
- package/locales/da.json +12 -0
- package/locales/de.json +12 -0
- package/locales/el.json +12 -0
- package/locales/en-GB.json +12 -0
- package/locales/en.json +12 -0
- package/locales/es-419.json +12 -0
- package/locales/es.json +12 -0
- package/locales/et.json +12 -0
- package/locales/fi.json +12 -0
- package/locales/fr-CA.json +12 -0
- package/locales/fr.json +12 -0
- package/locales/he.json +12 -0
- package/locales/hi.json +12 -0
- package/locales/ht.json +12 -0
- package/locales/hu.json +12 -0
- package/locales/id.json +12 -0
- package/locales/it.json +12 -0
- package/locales/ja.json +12 -0
- package/locales/km-KH.json +12 -0
- package/locales/ko.json +12 -0
- package/locales/lt.json +12 -0
- package/locales/lv.json +12 -0
- package/locales/mi.json +12 -0
- package/locales/ms.json +12 -0
- package/locales/nb.json +12 -0
- package/locales/nl.json +12 -0
- package/locales/pl.json +12 -0
- package/locales/pt-BR.json +12 -0
- package/locales/pt.json +12 -0
- package/locales/ro.json +12 -0
- package/locales/ru.json +12 -0
- package/locales/si-LK.json +12 -0
- package/locales/sk.json +12 -0
- package/locales/sr.json +12 -0
- package/locales/sv.json +12 -0
- package/locales/th.json +12 -0
- package/locales/tl.json +12 -0
- package/locales/tr.json +12 -0
- package/locales/uk.json +12 -0
- package/locales/vi.json +12 -0
- package/locales/zh-TW.json +12 -0
- package/locales/zh.json +12 -0
- package/package.json +2 -2
- package/src/Filter/FilterMultiSelect/subcomponents/SearchInput/SearchInput.tsx +15 -2
- package/src/Input/InputSearch/InputSearch.tsx +10 -1
- package/src/TitleBlockZen/TitleBlockZen.module.scss +0 -14
- package/src/TitleBlockZen/TitleBlockZen.tsx +1 -1
- package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +54 -0
package/locales/zh.json
CHANGED
|
@@ -21,6 +21,18 @@
|
|
|
21
21
|
"description" : "Label for the 'date to' field",
|
|
22
22
|
"message" : "结束日期"
|
|
23
23
|
},
|
|
24
|
+
"filterMultiSelectSearchInput.label" : {
|
|
25
|
+
"description" : "Label for the search input",
|
|
26
|
+
"message" : "按搜索查询筛选选项"
|
|
27
|
+
},
|
|
28
|
+
"filterMultiSelectSearchInput.placeholder" : {
|
|
29
|
+
"description" : "Placeholder for the search input",
|
|
30
|
+
"message" : "搜索…"
|
|
31
|
+
},
|
|
32
|
+
"inputSearch.clear" : {
|
|
33
|
+
"description" : "Label for the clear search button",
|
|
34
|
+
"message" : "清除搜索"
|
|
35
|
+
},
|
|
24
36
|
"kzErrorPage" : {
|
|
25
37
|
"description" : "Label for contact button",
|
|
26
38
|
"message" : "联系支持人员"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.51.0",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"tslib": "^2.6.3",
|
|
97
97
|
"tsx": "^4.15.1",
|
|
98
98
|
"@kaizen/design-tokens": "10.4.1",
|
|
99
|
-
"@kaizen/package-bundler": "1.1.
|
|
99
|
+
"@kaizen/package-bundler": "1.1.2"
|
|
100
100
|
},
|
|
101
101
|
"devDependenciesComments": {
|
|
102
102
|
"postcss": "Installed in root",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useId } from "react"
|
|
2
|
+
import { useIntl } from "@cultureamp/i18n-react-intl"
|
|
2
3
|
import { InputSearch } from "~components/Input/InputSearch"
|
|
3
4
|
import { useSelectionContext } from "../../context"
|
|
4
5
|
import styles from "./SearchInput.module.scss"
|
|
@@ -14,6 +15,7 @@ export const SearchInput = ({
|
|
|
14
15
|
id,
|
|
15
16
|
isLoading,
|
|
16
17
|
}: SearchInputProps): JSX.Element => {
|
|
18
|
+
const { formatMessage } = useIntl()
|
|
17
19
|
const { setSearchQuery, searchQuery } = useSelectionContext()
|
|
18
20
|
|
|
19
21
|
const handleChange: React.ChangeEventHandler<HTMLInputElement> = e => {
|
|
@@ -25,13 +27,24 @@ export const SearchInput = ({
|
|
|
25
27
|
const reactId = useId()
|
|
26
28
|
const inputId = id ?? reactId
|
|
27
29
|
|
|
30
|
+
const defaultAriaLabel = formatMessage({
|
|
31
|
+
id: "filterMultiSelectSearchInput.label",
|
|
32
|
+
defaultMessage: "Filter options by search query",
|
|
33
|
+
description: "Label for the search input",
|
|
34
|
+
})
|
|
35
|
+
const placeholder = formatMessage({
|
|
36
|
+
id: "filterMultiSelectSearchInput.placeholder",
|
|
37
|
+
defaultMessage: "Search…",
|
|
38
|
+
description: "Placeholder for the search input",
|
|
39
|
+
})
|
|
40
|
+
|
|
28
41
|
return (
|
|
29
42
|
<div className={styles.inputSearchContainer}>
|
|
30
43
|
<InputSearch
|
|
31
44
|
id={inputId}
|
|
32
|
-
aria-label={label ??
|
|
45
|
+
aria-label={label ?? defaultAriaLabel}
|
|
33
46
|
secondary
|
|
34
|
-
placeholder=
|
|
47
|
+
placeholder={placeholder}
|
|
35
48
|
value={searchQuery}
|
|
36
49
|
onChange={handleChange}
|
|
37
50
|
onClear={handleClear}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes, useRef } from "react"
|
|
2
|
+
import { useIntl } from "@cultureamp/i18n-react-intl"
|
|
2
3
|
import classnames from "classnames"
|
|
3
4
|
import { ClearButton } from "~components/ClearButton"
|
|
4
5
|
import { SearchIcon } from "~components/Icon/SearchIcon"
|
|
@@ -29,12 +30,20 @@ export const InputSearch = (props: InputSearchProps): JSX.Element => {
|
|
|
29
30
|
secondary = false,
|
|
30
31
|
...restProps
|
|
31
32
|
} = props
|
|
33
|
+
const { formatMessage } = useIntl()
|
|
32
34
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
33
35
|
|
|
34
36
|
const handleOnClear = (): void => {
|
|
35
37
|
inputRef.current?.focus()
|
|
36
38
|
onClear && onClear()
|
|
37
39
|
}
|
|
40
|
+
|
|
41
|
+
const clearButtonLabel = formatMessage({
|
|
42
|
+
id: "inputSearch.clear",
|
|
43
|
+
defaultMessage: "Clear search",
|
|
44
|
+
description: "Label for the clear search button",
|
|
45
|
+
})
|
|
46
|
+
|
|
38
47
|
return (
|
|
39
48
|
<div
|
|
40
49
|
className={classnames(
|
|
@@ -78,7 +87,7 @@ export const InputSearch = (props: InputSearchProps): JSX.Element => {
|
|
|
78
87
|
onClick={handleOnClear}
|
|
79
88
|
disabled={disabled}
|
|
80
89
|
classNameOverride={styles.endIconAdornment}
|
|
81
|
-
aria-label=
|
|
90
|
+
aria-label={clearButtonLabel}
|
|
82
91
|
/>
|
|
83
92
|
)}
|
|
84
93
|
</div>
|
|
@@ -171,17 +171,7 @@ $tab-container-height-medium-and-small-collapsed: 0;
|
|
|
171
171
|
.titleTextOverride.titleTextOverride {
|
|
172
172
|
padding: 4px 0;
|
|
173
173
|
|
|
174
|
-
@media (max-width: $breadcrumb-breakpoint-width) {
|
|
175
|
-
font-family: $typography-heading-2-font-family;
|
|
176
|
-
font-weight: $typography-heading-2-font-weight;
|
|
177
|
-
font-size: $typography-heading-2-font-size;
|
|
178
|
-
line-height: $typography-heading-2-line-height;
|
|
179
|
-
letter-spacing: $typography-heading-2-letter-spacing;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
174
|
@include title-block-under-1366 {
|
|
183
|
-
font-family: $typography-heading-2-font-family;
|
|
184
|
-
font-weight: $typography-heading-2-font-weight;
|
|
185
175
|
font-size: $typography-heading-2-font-size;
|
|
186
176
|
line-height: $typography-heading-2-line-height;
|
|
187
177
|
letter-spacing: $typography-heading-2-letter-spacing;
|
|
@@ -190,8 +180,6 @@ $tab-container-height-medium-and-small-collapsed: 0;
|
|
|
190
180
|
|
|
191
181
|
.hasLongTitle & {
|
|
192
182
|
@include title-block-under-1366 {
|
|
193
|
-
font-family: $typography-heading-3-font-family;
|
|
194
|
-
font-weight: $typography-heading-3-font-weight;
|
|
195
183
|
font-size: $typography-heading-3-font-size;
|
|
196
184
|
line-height: $typography-heading-3-line-height;
|
|
197
185
|
letter-spacing: $typography-heading-3-letter-spacing;
|
|
@@ -200,8 +188,6 @@ $tab-container-height-medium-and-small-collapsed: 0;
|
|
|
200
188
|
}
|
|
201
189
|
|
|
202
190
|
@include title-block-medium-and-small {
|
|
203
|
-
font-family: $typography-heading-4-font-family;
|
|
204
|
-
font-weight: $typography-heading-4-font-weight;
|
|
205
191
|
font-size: $typography-heading-4-font-size;
|
|
206
192
|
line-height: $typography-heading-4-line-height;
|
|
207
193
|
letter-spacing: $typography-heading-4-letter-spacing;
|
|
@@ -329,7 +329,7 @@ export const TitleBlockZen = ({
|
|
|
329
329
|
<div className={styles.titleAndSubtitleInner}>
|
|
330
330
|
<div className={styles.title}>
|
|
331
331
|
<Heading
|
|
332
|
-
variant="
|
|
332
|
+
variant="composable-header-title"
|
|
333
333
|
color={isReversed(variant) ? "white" : "dark"}
|
|
334
334
|
classNameOverride={styles.titleTextOverride}
|
|
335
335
|
data-automation-id={titleAutomationId}
|
|
@@ -98,6 +98,60 @@ export const Playground: Story = {
|
|
|
98
98
|
},
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
export const Viewports: Story = {
|
|
102
|
+
parameters: {
|
|
103
|
+
viewport: {
|
|
104
|
+
viewports: {
|
|
105
|
+
default: {
|
|
106
|
+
name: "Above or equal to 1366",
|
|
107
|
+
styles: { width: "1366px", height: "800px" },
|
|
108
|
+
type: "desktop",
|
|
109
|
+
},
|
|
110
|
+
under1366: {
|
|
111
|
+
name: "Under 1366",
|
|
112
|
+
styles: { width: "1365px", height: "800px" },
|
|
113
|
+
type: "desktop",
|
|
114
|
+
},
|
|
115
|
+
mediumSmall: {
|
|
116
|
+
name: "Medium and small",
|
|
117
|
+
styles: { width: "1079px", height: "800px" },
|
|
118
|
+
type: "desktop",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
defaultViewport: "default",
|
|
122
|
+
},
|
|
123
|
+
chromatic: {
|
|
124
|
+
disable: false,
|
|
125
|
+
viewports: [1079, 1365, 1366],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const HasLongTitle: Story = {
|
|
131
|
+
parameters: {
|
|
132
|
+
viewport: {
|
|
133
|
+
viewports: {
|
|
134
|
+
default: {
|
|
135
|
+
name: "Above or equal to 1366",
|
|
136
|
+
styles: { width: "1366px", height: "800px" },
|
|
137
|
+
type: "desktop",
|
|
138
|
+
},
|
|
139
|
+
under1366: {
|
|
140
|
+
name: "Under 1366",
|
|
141
|
+
styles: { width: "1365px", height: "800px" },
|
|
142
|
+
type: "desktop",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
defaultViewport: "default",
|
|
146
|
+
},
|
|
147
|
+
chromatic: {
|
|
148
|
+
disable: false,
|
|
149
|
+
viewports: [1365, 1366],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
args: { title: "A long title with over thirty characters" },
|
|
153
|
+
}
|
|
154
|
+
|
|
101
155
|
export const StickerSheetDefault: Story = {
|
|
102
156
|
parameters: {
|
|
103
157
|
docs: {
|