@northlight/ui 2.43.2 → 2.43.4
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/es/northlight.d.ts +1 -0
- package/dist/es/northlight.js +10 -8
- package/dist/es/northlight.js.map +1 -1
- package/dist/sandbox/index.cjs +9 -7
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.js +9 -7
- package/dist/sandbox/index.js.map +1 -1
- package/dist/umd/northlight.cjs +10 -8
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/lib/components/date-picker/components/date-field/types.ts +3 -8
- package/lib/components/date-picker/date-picker/date-picker.tsx +4 -2
- package/lib/components/date-picker/date-picker/date-range-picker.tsx +3 -4
- package/lib/components/date-picker/types.ts +3 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import { HTMLAttributes, ReactNode } from 'react'
|
|
|
2
2
|
import { DateValue } from '@internationalized/date'
|
|
3
3
|
import { AriaDateFieldProps } from '@react-aria/datepicker'
|
|
4
4
|
import { DateFieldState, DateSegment } from '@react-stately/datepicker'
|
|
5
|
+
import { AriaButtonProps } from '@react-aria/button'
|
|
5
6
|
|
|
6
7
|
export type DateSegmentType = DateSegment
|
|
7
8
|
export interface DateFieldProps extends AriaDateFieldProps<DateValue> {
|
|
@@ -19,13 +20,7 @@ export interface StyledFieldProps extends HTMLAttributes<HTMLElement> {
|
|
|
19
20
|
children: ReactNode
|
|
20
21
|
variant?: 'outline' | 'filled'
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false'
|
|
25
|
-
'aria-label'?: string
|
|
26
|
-
'aria-labelledby'?: string
|
|
27
|
-
'aria-describedby'?: string
|
|
28
|
-
'aria-expanded'?: boolean | 'true' | 'false'
|
|
29
|
-
isDisabled?: boolean
|
|
23
|
+
|
|
24
|
+
export interface TriggerProps extends AriaButtonProps {
|
|
30
25
|
handleClick: () => void
|
|
31
26
|
}
|
|
@@ -63,6 +63,7 @@ import { DatePickerLocaleWrapper } from './date-picker-locale-wrapper'
|
|
|
63
63
|
*/
|
|
64
64
|
export const DatePicker = (props: DatePickerProps) => {
|
|
65
65
|
const {
|
|
66
|
+
'data-testid': dataTestId,
|
|
66
67
|
isDisabled,
|
|
67
68
|
isClearable = true,
|
|
68
69
|
resetDate,
|
|
@@ -250,7 +251,7 @@ export const DatePicker = (props: DatePickerProps) => {
|
|
|
250
251
|
placement="bottom-end"
|
|
251
252
|
>
|
|
252
253
|
<PopoverAnchor>
|
|
253
|
-
<HStack minW={ 56 }>
|
|
254
|
+
<HStack minW={ 56 } data-testid={ dataTestId }>
|
|
254
255
|
<InputGroup
|
|
255
256
|
role={ groupRole }
|
|
256
257
|
id={ groupId }
|
|
@@ -271,7 +272,7 @@ export const DatePicker = (props: DatePickerProps) => {
|
|
|
271
272
|
isInvalid={ isInvalid }
|
|
272
273
|
variant={ variant }
|
|
273
274
|
>
|
|
274
|
-
<Box paddingInlineStart="1a" paddingInlineEnd={ 10 }>
|
|
275
|
+
<Box paddingInlineStart="1a" data-testid="date-picker-input-field" paddingInlineEnd={ 10 }>
|
|
275
276
|
<DateField
|
|
276
277
|
{ ...restFieldProps }
|
|
277
278
|
id={ fieldId }
|
|
@@ -299,6 +300,7 @@ export const DatePicker = (props: DatePickerProps) => {
|
|
|
299
300
|
<InputRightElement
|
|
300
301
|
sx={ { height: '100%', paddingRight: '1' } }
|
|
301
302
|
zIndex={ 0 }
|
|
303
|
+
data-testid="date-picker-trigger"
|
|
302
304
|
>
|
|
303
305
|
<Trigger
|
|
304
306
|
id={ buttonId }
|
|
@@ -179,7 +179,6 @@ export const DateRangePicker = (props: DateRangePickerProps) => {
|
|
|
179
179
|
startName,
|
|
180
180
|
endName,
|
|
181
181
|
'aria-label': 'Date range picker',
|
|
182
|
-
...(!isNil(dataTestId) && { 'data-testid': dataTestId }),
|
|
183
182
|
},
|
|
184
183
|
state,
|
|
185
184
|
ref
|
|
@@ -344,7 +343,7 @@ export const DateRangePicker = (props: DateRangePickerProps) => {
|
|
|
344
343
|
placement="bottom-start"
|
|
345
344
|
>
|
|
346
345
|
<PopoverAnchor>
|
|
347
|
-
<HStack>
|
|
346
|
+
<HStack data-testid={ dataTestId }>
|
|
348
347
|
<InputGroup
|
|
349
348
|
role={ groupRole }
|
|
350
349
|
id={ groupId }
|
|
@@ -365,7 +364,7 @@ export const DateRangePicker = (props: DateRangePickerProps) => {
|
|
|
365
364
|
isInvalid={ isInvalid }
|
|
366
365
|
variant={ variant }
|
|
367
366
|
>
|
|
368
|
-
<HStack paddingInlineStart="1a" paddingInlineEnd={ 10 }>
|
|
367
|
+
<HStack paddingInlineStart="1a" data-testid="daterange-picker-input-field" paddingInlineEnd={ 10 }>
|
|
369
368
|
<DateField
|
|
370
369
|
{ ...restStartFieldProps }
|
|
371
370
|
id={ startFieldId }
|
|
@@ -412,7 +411,7 @@ export const DateRangePicker = (props: DateRangePickerProps) => {
|
|
|
412
411
|
/>
|
|
413
412
|
</HStack>
|
|
414
413
|
</StyledField>
|
|
415
|
-
<InputRightElement sx={ { height: '100%', paddingRight: '1' } }>
|
|
414
|
+
<InputRightElement data-test-id="daterange-picker-trigger" sx={ { height: '100%', paddingRight: '1' } }>
|
|
416
415
|
<Trigger
|
|
417
416
|
id={ buttonId }
|
|
418
417
|
aria-haspopup={ buttonAriaHasPopup }
|
|
@@ -29,7 +29,9 @@ interface DatePickerSettings {
|
|
|
29
29
|
|
|
30
30
|
export interface DatePickerProps
|
|
31
31
|
extends Omit<AriaDatePickerProps<DateValue>, 'firstDayOfWeek'>,
|
|
32
|
-
DatePickerSettings {
|
|
32
|
+
DatePickerSettings {
|
|
33
|
+
'data-testid': string
|
|
34
|
+
}
|
|
33
35
|
|
|
34
36
|
export interface DateRangePickerProps
|
|
35
37
|
extends Omit<AriaDateRangePickerProps<DateValue>, 'firstDayOfWeek' | 'onChange' | 'value' | 'minValue' | 'maxValue'>,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@northlight/ui",
|
|
3
|
-
"version": "2.43.
|
|
3
|
+
"version": "2.43.4",
|
|
4
4
|
"description": "Northlight UI library, based on Chakra-ui",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Camphouse",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"react-dom": ">=18.0.0",
|
|
127
127
|
"react-router-dom": "^5.0.0"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "1b5d93f45e2c08f518dd0c07184bd57e1fcbd031"
|
|
130
130
|
}
|