@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.
Files changed (44) hide show
  1. package/dist/cjs/index.cjs +2 -0
  2. package/dist/cjs/src/Brand/Brand.cjs +1 -1
  3. package/dist/cjs/src/DateInput/DateInput/DateInput.cjs +1 -1
  4. package/dist/cjs/src/DateInput/DateInput/DateInput.module.css.cjs +7 -0
  5. package/dist/cjs/src/DateInput/DateInputDescription/DateInputDescription.cjs +1 -1
  6. package/dist/cjs/src/DateInput/DateInputDescription/{DateInputDescription.module.scss.cjs → DateInputDescription.module.css.cjs} +4 -4
  7. package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.cjs +1 -1
  8. package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.css.cjs +8 -0
  9. package/dist/cjs/src/DatePicker/subcomponents/DateInputField/DateInputField.cjs +1 -1
  10. package/dist/cjs/src/DatePicker/subcomponents/DateInputField/DateInputField.module.css.cjs +6 -0
  11. package/dist/esm/index.mjs +1 -0
  12. package/dist/esm/src/Brand/Brand.mjs +1 -1
  13. package/dist/esm/src/DateInput/DateInput/DateInput.mjs +3 -3
  14. package/dist/esm/src/DateInput/DateInput/DateInput.module.css.mjs +5 -0
  15. package/dist/esm/src/DateInput/DateInputDescription/DateInputDescription.mjs +3 -3
  16. package/dist/esm/src/DateInput/DateInputDescription/{DateInputDescription.module.scss.mjs → DateInputDescription.module.css.mjs} +4 -4
  17. package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.mjs +2 -2
  18. package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.css.mjs +6 -0
  19. package/dist/esm/src/DatePicker/subcomponents/DateInputField/DateInputField.mjs +2 -2
  20. package/dist/esm/src/DatePicker/subcomponents/DateInputField/DateInputField.module.css.mjs +4 -0
  21. package/dist/styles.css +19 -19
  22. package/dist/types/SingleSelect/index.d.ts +1 -0
  23. package/package.json +8 -8
  24. package/src/Brand/Brand.tsx +2 -2
  25. package/src/DateInput/DateInput/{DateInput.module.scss → DateInput.module.css} +1 -3
  26. package/src/DateInput/DateInput/DateInput.tsx +1 -1
  27. package/src/DateInput/DateInputDescription/{DateInputDescription.module.scss → DateInputDescription.module.css} +2 -4
  28. package/src/DateInput/DateInputDescription/DateInputDescription.tsx +1 -1
  29. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.css +43 -0
  30. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.tsx +1 -1
  31. package/src/DatePicker/DatePicker.module.css +9 -0
  32. package/src/DatePicker/_docs/DatePicker.stories.tsx +28 -28
  33. package/src/DatePicker/subcomponents/DateInputField/DateInputField.module.css +9 -0
  34. package/src/DatePicker/subcomponents/DateInputField/DateInputField.tsx +1 -1
  35. package/src/SingleSelect/index.ts +1 -0
  36. package/dist/cjs/src/DateInput/DateInput/DateInput.module.scss.cjs +0 -7
  37. package/dist/cjs/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss.cjs +0 -8
  38. package/dist/cjs/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss.cjs +0 -6
  39. package/dist/esm/src/DateInput/DateInput/DateInput.module.scss.mjs +0 -5
  40. package/dist/esm/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss.mjs +0 -6
  41. package/dist/esm/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss.mjs +0 -4
  42. package/src/DateInput/DateInputWithIconButton/DateInputWithIconButton.module.scss +0 -44
  43. package/src/DatePicker/DatePicker.module.scss +0 -11
  44. package/src/DatePicker/subcomponents/DateInputField/DateInputField.module.scss +0 -7
@@ -1,3 +1,4 @@
1
1
  export * from './SingleSelect';
2
2
  export * from './types';
3
+ export * from './subcomponents/SelectToggle';
3
4
  export { SingleSelect, type SingleSelectProps } from './SingleSelect';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "3.0.9",
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.4",
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.4.27",
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.9",
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.0",
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.4",
155
- "react-dom": "^19.2.4",
154
+ "react": "^19.2.5",
155
+ "react-dom": "^19.2.5",
156
156
  "react-highlight": "^0.15.0",
157
- "react-intl": "^7.1.14",
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",
@@ -30,8 +30,8 @@ export type BrandProps = {
30
30
 
31
31
  const isSVG = (
32
32
  variant: VariantSVG['variant'] | VariantPicture['variant'],
33
- restProps: SVGProps | PictureProps,
34
- ): restProps is SVGProps => variant === 'collective-intelligence'
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)) {
@@ -1,11 +1,9 @@
1
- @import '~@kaizen/design-tokens/sass/spacing';
2
-
3
1
  @layer kz-components {
4
2
  .dateInput {
5
3
  width: 100%;
6
4
  }
7
5
 
8
6
  .input {
9
- margin-top: $spacing-6;
7
+ margin-top: var(--spacing-6);
10
8
  }
11
9
  }
@@ -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.scss'
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: $spacing-xs;
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: $spacing-xs;
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.scss'
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.scss'
6
+ import styles from './DateInputWithIconButton.module.css'
7
7
 
8
8
  export type DateInputWithIconButtonProps = {
9
9
  /**
@@ -0,0 +1,9 @@
1
+ @layer kz-components {
2
+ .datePicker {
3
+ color: var(--color-purple-800);
4
+ }
5
+
6
+ .isReversed {
7
+ color: var(--color-yellow-600);
8
+ }
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
- </Text>
189
- <ul>
190
- <li>
191
- There will be a caution when the selectedDay <strong>is valid</strong> but{' '}
192
- <strong>is not within this year</strong>.
193
- </li>
194
- <li>
195
- There will be an error when the <strong>submit button is clicked</strong> and there is
196
- a <strong>current error</strong> within the DatePicker.
197
- </li>
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
- <ul>
206
- <li>
207
- <code>isInvalid</code>: A date that cannot be parsed. e.g &quot;potato&quot;.
208
- </li>
209
- <li>
210
- <code>isDisabled</code>: A date that have been set as disabled through the{' '}
211
- <code>disabledDates</code> prop.
212
- </li>
213
- <li>
214
- <code>isEmpty</code>: Input is empty.
215
- </li>
216
- <li>
217
- <code>isValidDate</code>: Date input that is not <code>invalid</code> nor{' '}
218
- <code>disabled</code> nor <code>empty</code>.
219
- </li>
220
- </ul>
203
+ <Text variant="body">
204
+ <ul>
205
+ <li>
206
+ <code>isInvalid</code>: A date that cannot be parsed. e.g &quot;potato&quot;.
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
  )
@@ -0,0 +1,9 @@
1
+ @layer kz-components {
2
+ :root {
3
+ --input-disabled-opacity: 0.3;
4
+ }
5
+
6
+ .disabled {
7
+ opacity: var(--input-disabled-opacity);
8
+ }
9
+ }
@@ -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.scss'
13
+ import styles from './DateInputField.module.css'
14
14
 
15
15
  export type DateInputFieldProps = {
16
16
  /**
@@ -1,4 +1,5 @@
1
1
  export * from './SingleSelect'
2
2
  export * from './types'
3
+ export * from './subcomponents/SelectToggle'
3
4
 
4
5
  export { SingleSelect, type SingleSelectProps } from './SingleSelect'
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var modules_0755dfa8 = {
4
- "dateInput": "DateInput_module_dateInput__ddfc3633",
5
- "input": "DateInput_module_input__ddfc3633"
6
- };
7
- module.exports = modules_0755dfa8;
@@ -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;
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- var modules_99160b40 = {
4
- "disabled": "DateInputField_module_disabled__e4d317ee"
5
- };
6
- module.exports = modules_99160b40;
@@ -1,5 +0,0 @@
1
- var modules_0755dfa8 = {
2
- "dateInput": "DateInput_module_dateInput__ddfc3633",
3
- "input": "DateInput_module_input__ddfc3633"
4
- };
5
- export { modules_0755dfa8 as default };
@@ -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,4 +0,0 @@
1
- var modules_99160b40 = {
2
- "disabled": "DateInputField_module_disabled__e4d317ee"
3
- };
4
- export { modules_99160b40 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
- }
@@ -1,11 +0,0 @@
1
- @import '~@kaizen/design-tokens/sass/color';
2
-
3
- @layer kz-components {
4
- .datePicker {
5
- color: $color-purple-800;
6
- }
7
-
8
- .isReversed {
9
- color: $color-yellow-600;
10
- }
11
- }
@@ -1,7 +0,0 @@
1
- @layer kz-components {
2
- $input-disabled-opacity: 0.3;
3
-
4
- .disabled {
5
- opacity: $input-disabled-opacity;
6
- }
7
- }