@kaizen/components 3.0.9 → 3.0.11
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/index.cjs +2 -0
- package/dist/cjs/src/Brand/Brand.cjs +1 -1
- package/dist/cjs/src/DateInput/DateInput/DateInput.cjs +1 -1
- package/dist/cjs/src/DateInput/DateInput/DateInput.module.css.cjs +7 -0
- package/dist/cjs/src/DateInput/DateInputDescription/DateInputDescription.cjs +1 -1
- package/dist/cjs/src/DateInput/DateInputDescription/{DateInputDescription.module.scss.cjs → DateInputDescription.module.css.cjs} +4 -4
- package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.cjs +1 -1
- package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.css.cjs +8 -0
- package/dist/cjs/src/DatePicker/subcomponents/DateInputField/DateInputField.cjs +1 -1
- package/dist/cjs/src/DatePicker/subcomponents/DateInputField/DateInputField.module.css.cjs +6 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/src/Brand/Brand.mjs +1 -1
- package/dist/esm/src/DateInput/DateInput/DateInput.mjs +3 -3
- package/dist/esm/src/DateInput/DateInput/DateInput.module.css.mjs +5 -0
- package/dist/esm/src/DateInput/DateInputDescription/DateInputDescription.mjs +3 -3
- package/dist/esm/src/DateInput/DateInputDescription/{DateInputDescription.module.scss.mjs → DateInputDescription.module.css.mjs} +4 -4
- package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.mjs +2 -2
- package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.css.mjs +6 -0
- package/dist/esm/src/DatePicker/subcomponents/DateInputField/DateInputField.mjs +2 -2
- package/dist/esm/src/DatePicker/subcomponents/DateInputField/DateInputField.module.css.mjs +4 -0
- package/dist/styles.css +19 -19
- package/dist/types/SingleSelect/index.d.ts +1 -0
- package/package.json +8 -8
- package/src/Brand/Brand.tsx +2 -2
- package/src/DateInput/DateInput/{DateInput.module.scss → DateInput.module.css} +1 -3
- package/src/DateInput/DateInput/DateInput.tsx +1 -1
- package/src/DateInput/DateInputDescription/{DateInputDescription.module.scss → DateInputDescription.module.css} +2 -4
- package/src/DateInput/DateInputDescription/DateInputDescription.tsx +1 -1
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.css +43 -0
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.tsx +1 -1
- package/src/DatePicker/DatePicker.module.css +9 -0
- package/src/DatePicker/_docs/DatePicker.stories.tsx +28 -28
- package/src/DatePicker/subcomponents/DateInputField/DateInputField.module.css +9 -0
- package/src/DatePicker/subcomponents/DateInputField/DateInputField.tsx +1 -1
- package/src/SingleSelect/index.ts +1 -0
- package/dist/cjs/src/DateInput/DateInput/DateInput.module.scss.cjs +0 -7
- package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss.cjs +0 -8
- package/dist/cjs/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss.cjs +0 -6
- package/dist/esm/src/DateInput/DateInput/DateInput.module.scss.mjs +0 -5
- package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss.mjs +0 -6
- package/dist/esm/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss.mjs +0 -4
- package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +0 -44
- package/src/DatePicker/DatePicker.module.scss +0 -11
- package/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -132,29 +132,29 @@
|
|
|
132
132
|
"@cultureamp/frontend-apis": "13.3.0",
|
|
133
133
|
"@cultureamp/i18n-react-intl": "^4.1.1",
|
|
134
134
|
"@cultureamp/package-bundler": "^4.0.1",
|
|
135
|
-
"cssnano": "^7.1.
|
|
135
|
+
"cssnano": "^7.1.5",
|
|
136
136
|
"@testing-library/dom": "^10.4.1",
|
|
137
137
|
"@types/jest-axe": "^3.5.9",
|
|
138
138
|
"@types/lodash.debounce": "^4.0.9",
|
|
139
139
|
"@types/react-highlight": "^0.12.8",
|
|
140
140
|
"@types/react-textfit": "^1.1.4",
|
|
141
141
|
"@types/uuid": "^11.0.0",
|
|
142
|
-
"autoprefixer": "^10.
|
|
142
|
+
"autoprefixer": "^10.5.0",
|
|
143
143
|
"concat-cli": "^4.0.0",
|
|
144
144
|
"identity-obj-proxy": "^3.0.0",
|
|
145
145
|
"jest-axe": "^10.0.0",
|
|
146
146
|
"lodash.isempty": "^4.4.0",
|
|
147
147
|
"normalize.css": "^8.0.1",
|
|
148
|
-
"postcss": "^8.5.
|
|
148
|
+
"postcss": "^8.5.10",
|
|
149
149
|
"postcss-cli": "^11.0.1",
|
|
150
150
|
"postcss-import": "^16.1.1",
|
|
151
|
-
"postcss-preset-env": "^11.2.
|
|
151
|
+
"postcss-preset-env": "^11.2.1",
|
|
152
152
|
"postcss-scss": "^4.0.9",
|
|
153
153
|
"query-string": "^9.3.1",
|
|
154
|
-
"react": "^19.2.
|
|
155
|
-
"react-dom": "^19.2.
|
|
154
|
+
"react": "^19.2.5",
|
|
155
|
+
"react-dom": "^19.2.5",
|
|
156
156
|
"react-highlight": "^0.15.0",
|
|
157
|
-
"react-intl": "^
|
|
157
|
+
"react-intl": "^10.1.2",
|
|
158
158
|
"rollup": "^4.60.1",
|
|
159
159
|
"sass": "1.79.6",
|
|
160
160
|
"serialize-query-params": "^2.0.4",
|
package/src/Brand/Brand.tsx
CHANGED
|
@@ -30,8 +30,8 @@ export type BrandProps = {
|
|
|
30
30
|
|
|
31
31
|
const isSVG = (
|
|
32
32
|
variant: VariantSVG['variant'] | VariantPicture['variant'],
|
|
33
|
-
|
|
34
|
-
):
|
|
33
|
+
_restProps: SVGProps | PictureProps,
|
|
34
|
+
): _restProps is SVGProps => variant === 'collective-intelligence'
|
|
35
35
|
|
|
36
36
|
export const Brand = ({ reversed = false, variant, ...restProps }: BrandProps): JSX.Element => {
|
|
37
37
|
if (isSVG(variant, restProps)) {
|
|
@@ -3,7 +3,7 @@ import classnames from 'classnames'
|
|
|
3
3
|
import { Input, type InputProps } from '~components/Input'
|
|
4
4
|
import { Label } from '~components/Label'
|
|
5
5
|
import { isRefObject } from '~components/utils/isRefObject'
|
|
6
|
-
import styles from './DateInput.module.
|
|
6
|
+
import styles from './DateInput.module.css'
|
|
7
7
|
|
|
8
8
|
type OmittedInputProps = 'reversed' | 'type' | 'inputRef'
|
|
9
9
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
@import '~@kaizen/design-tokens/sass/spacing';
|
|
2
|
-
|
|
3
1
|
@layer kz-components {
|
|
4
2
|
.dateInputDescription {
|
|
5
3
|
display: inline;
|
|
6
4
|
}
|
|
7
5
|
|
|
8
6
|
.dateInputFormatContainer {
|
|
9
|
-
margin-inline-start:
|
|
7
|
+
margin-inline-start: var(--spacing-xs);
|
|
10
8
|
white-space: nowrap;
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -16,6 +14,6 @@
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
.labelSeparator {
|
|
19
|
-
margin-inline-end:
|
|
17
|
+
margin-inline-end: var(--spacing-xs);
|
|
20
18
|
}
|
|
21
19
|
}
|
|
@@ -3,7 +3,7 @@ import { useIntl } from '@cultureamp/i18n-react-intl'
|
|
|
3
3
|
import type { Locale } from 'date-fns'
|
|
4
4
|
import { LabelledMessage } from '~components/LabelledMessage'
|
|
5
5
|
import { formatDescriptionInputFormat } from './utils/formatDescriptionInputFormat'
|
|
6
|
-
import styles from './DateInputDescription.module.
|
|
6
|
+
import styles from './DateInputDescription.module.css'
|
|
7
7
|
|
|
8
8
|
export type DateInputDescriptionProps = {
|
|
9
9
|
description?: string | JSX.Element
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
:root {
|
|
3
|
+
--input-disabled-opacity: 0.3;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.iconButton {
|
|
7
|
+
/* Button reset: repace @include button-reset */
|
|
8
|
+
appearance: none;
|
|
9
|
+
background: transparent;
|
|
10
|
+
color: inherit;
|
|
11
|
+
font: inherit;
|
|
12
|
+
margin: 0;
|
|
13
|
+
|
|
14
|
+
/* Styles */
|
|
15
|
+
display: flex;
|
|
16
|
+
padding: var(--spacing-6);
|
|
17
|
+
border: var(--border-solid-border-width) var(--border-solid-border-style) transparent;
|
|
18
|
+
border-radius: var(--border-solid-border-radius);
|
|
19
|
+
position: relative;
|
|
20
|
+
inset-inline-end: -0.35rem;
|
|
21
|
+
top: -40%;
|
|
22
|
+
|
|
23
|
+
&:focus-visible {
|
|
24
|
+
outline-offset: -2px;
|
|
25
|
+
outline: var(--color-blue-500) var(--border-focus-ring-border-style)
|
|
26
|
+
var(--border-focus-ring-border-width);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover:not([disabled]) {
|
|
30
|
+
background-color: var(--color-blue-100);
|
|
31
|
+
color: var(--color-blue-500);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.calendarActive {
|
|
36
|
+
color: var(--color-blue-500);
|
|
37
|
+
background-color: var(--color-blue-100);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.disabled {
|
|
41
|
+
opacity: var(--input-disabled-opacity);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -3,7 +3,7 @@ import classnames from 'classnames'
|
|
|
3
3
|
import { Icon } from '~components/Icon'
|
|
4
4
|
import { isRefObject } from '~components/utils/isRefObject'
|
|
5
5
|
import { DateInput, type DateInputProps } from '../DateInput'
|
|
6
|
-
import styles from './DateInputWithIconButton.module.
|
|
6
|
+
import styles from './DateInputWithIconButton.module.css'
|
|
7
7
|
|
|
8
8
|
export type DateInputWithIconButtonProps = {
|
|
9
9
|
/**
|
|
@@ -185,39 +185,39 @@ export const Validation: Story = {
|
|
|
185
185
|
<Text variant="body">
|
|
186
186
|
NOTE: This story includes additional custom validation to provide some guidance when
|
|
187
187
|
dealing with validation other than date isInvalid or isDisabled.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
</
|
|
198
|
-
</ul>
|
|
199
|
-
<Text variant="body">
|
|
188
|
+
<ul>
|
|
189
|
+
<li>
|
|
190
|
+
There will be a caution when the selectedDay <strong>is valid</strong> but{' '}
|
|
191
|
+
<strong>is not within this year</strong>.
|
|
192
|
+
</li>
|
|
193
|
+
<li>
|
|
194
|
+
There will be an error when the <strong>submit button is clicked</strong> and there
|
|
195
|
+
is a <strong>current error</strong> within the DatePicker.
|
|
196
|
+
</li>
|
|
197
|
+
</ul>
|
|
200
198
|
The <code>onValidate</code> callback returns a <code>validationResponse</code> object
|
|
201
199
|
which provides data such as a default validation message, and can be utilised for custom
|
|
202
200
|
validation.
|
|
203
201
|
</Text>
|
|
204
202
|
<Highlight className="json">{JSON.stringify(response, null, 4)}</Highlight>
|
|
205
|
-
<
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
203
|
+
<Text variant="body">
|
|
204
|
+
<ul>
|
|
205
|
+
<li>
|
|
206
|
+
<code>isInvalid</code>: A date that cannot be parsed. e.g "potato".
|
|
207
|
+
</li>
|
|
208
|
+
<li>
|
|
209
|
+
<code>isDisabled</code>: A date that have been set as disabled through the{' '}
|
|
210
|
+
<code>disabledDates</code> prop.
|
|
211
|
+
</li>
|
|
212
|
+
<li>
|
|
213
|
+
<code>isEmpty</code>: Input is empty.
|
|
214
|
+
</li>
|
|
215
|
+
<li>
|
|
216
|
+
<code>isValidDate</code>: Date input that is not <code>invalid</code> nor{' '}
|
|
217
|
+
<code>disabled</code> nor <code>empty</code>.
|
|
218
|
+
</li>
|
|
219
|
+
</ul>
|
|
220
|
+
</Text>
|
|
221
221
|
</div>
|
|
222
222
|
</>
|
|
223
223
|
)
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type DateInputWithIconButtonRefs,
|
|
11
11
|
} from '~components/DateInput'
|
|
12
12
|
import { FieldMessage, type FieldMessageStatus } from '~components/FieldMessage'
|
|
13
|
-
import styles from './DateInputField.module.
|
|
13
|
+
import styles from './DateInputField.module.css'
|
|
14
14
|
|
|
15
15
|
export type DateInputFieldProps = {
|
|
16
16
|
/**
|
package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var modules_d90a2c0e = {
|
|
4
|
-
"iconButton": "DateInputWithIconButton_module_iconButton__dffd0a18",
|
|
5
|
-
"calendarActive": "DateInputWithIconButton_module_calendarActive__dffd0a18",
|
|
6
|
-
"disabled": "DateInputWithIconButton_module_disabled__dffd0a18"
|
|
7
|
-
};
|
|
8
|
-
module.exports = modules_d90a2c0e;
|
package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var modules_d90a2c0e = {
|
|
2
|
-
"iconButton": "DateInputWithIconButton_module_iconButton__dffd0a18",
|
|
3
|
-
"calendarActive": "DateInputWithIconButton_module_calendarActive__dffd0a18",
|
|
4
|
-
"disabled": "DateInputWithIconButton_module_disabled__dffd0a18"
|
|
5
|
-
};
|
|
6
|
-
export { modules_d90a2c0e as default };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
@import '~@kaizen/design-tokens/sass/color';
|
|
2
|
-
@import '~@kaizen/design-tokens/sass/spacing';
|
|
3
|
-
@import '~@kaizen/design-tokens/sass/border';
|
|
4
|
-
@import '../../../styles/utils/animation';
|
|
5
|
-
@import '../../../styles/utils/button-reset';
|
|
6
|
-
|
|
7
|
-
@layer kz-components {
|
|
8
|
-
$input-disabled-opacity: 0.3;
|
|
9
|
-
|
|
10
|
-
.iconButton {
|
|
11
|
-
@include button-reset;
|
|
12
|
-
|
|
13
|
-
display: flex;
|
|
14
|
-
padding: var(--spacing-6);
|
|
15
|
-
border: $border-solid-border-width $border-solid-border-style transparent;
|
|
16
|
-
border-radius: $border-solid-border-radius;
|
|
17
|
-
position: relative;
|
|
18
|
-
inset-inline-end: -0.35rem;
|
|
19
|
-
top: -40%;
|
|
20
|
-
|
|
21
|
-
:focus {
|
|
22
|
-
outline: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:focus-visible {
|
|
26
|
-
outline-offset: -2px;
|
|
27
|
-
outline: $color-blue-500 $border-focus-ring-border-style $border-focus-ring-border-width;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&:hover:not([disabled]) {
|
|
31
|
-
background-color: $color-blue-100;
|
|
32
|
-
color: $color-blue-500;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.calendarActive {
|
|
37
|
-
color: $color-blue-500;
|
|
38
|
-
background-color: $color-blue-100;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.disabled {
|
|
42
|
-
opacity: $input-disabled-opacity;
|
|
43
|
-
}
|
|
44
|
-
}
|