@entur/datepicker 10.1.2 → 11.0.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.
@@ -1,5 +1,5 @@
1
1
  import { ZonedDateTime, CalendarDateTime, Time, DateValue, CalendarDate } from '@internationalized/date';
2
- import { TimeValue } from '@react-types/datepicker';
2
+ import { MappedDateValue, TimeValue } from '@react-types/datepicker';
3
3
  import { Calendar } from '@internationalized/date';
4
4
  /**
5
5
  * Tar inn et JS Date-objekt og returnerer et av DateValue-objektene fra @internationalized/date-pakken
@@ -38,3 +38,10 @@ export declare const modulo: (a: number, b: number) => number;
38
38
  export declare const focusSegment: (ref: React.RefObject<HTMLDivElement>, segment: "first" | "last") => void;
39
39
  /** Based on code from https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php */
40
40
  export declare function getWeekNumberForDate(date: DateValue | null): number;
41
+ export type ForcedReturnType = 'CalendarDate' | 'CalendarDateTime' | 'ZonedDateTime' | undefined;
42
+ export declare function handleOnChange<DateType extends DateValue>({ value, selectedDate, forcedReturnType, onChange, }: {
43
+ value: MappedDateValue<DateType> | null;
44
+ selectedDate: DateType | null;
45
+ forcedReturnType: ForcedReturnType;
46
+ onChange?: ((value: MappedDateValue<DateType> | null) => void) | ((value: DateValue | null) => void);
47
+ }): void;
package/dist/styles.css CHANGED
@@ -1,5 +1,29 @@
1
1
  /* DO NOT CHANGE!*/
2
2
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
3
+ .eds-date-and-time-field__segment {
4
+ margin-top: 1rem;
5
+ padding: 0 2px;
6
+ font-feature-settings: "tnum";
7
+ font-variant-numeric: tabular-nums;
8
+ text-align: right;
9
+ }
10
+ .eds-date-and-time-field__segment--placeholder {
11
+ color: var(--components-datepicker-datefield-standard-text-content);
12
+ }
13
+ .eds-date-and-time-field__segment--dot-separator {
14
+ margin-left: -0.1rem;
15
+ margin-right: -0.2rem;
16
+ }
17
+ .eds-date-and-time-field__segment:focus-visible {
18
+ background-color: var(--components-button-iconbutton-standard-active);
19
+ outline: transparent;
20
+ border-radius: 0.0625rem;
21
+ }
22
+ .eds-date-and-time-field__segment[aria-valuemax="9999"] {
23
+ min-width: 4ch;
24
+ }
25
+ /* DO NOT CHANGE!*/
26
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
3
27
  .eds-datepicker__calendar,
4
28
  .eds-contrast .eds-datepicker__calendar {
5
29
  width: -moz-fit-content;
@@ -140,30 +164,6 @@
140
164
  }
141
165
  /* DO NOT CHANGE!*/
142
166
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
143
- .eds-date-and-time-field__segment {
144
- margin-top: 1rem;
145
- padding: 0 2px;
146
- font-feature-settings: "tnum";
147
- font-variant-numeric: tabular-nums;
148
- text-align: right;
149
- }
150
- .eds-date-and-time-field__segment--placeholder {
151
- color: var(--components-datepicker-datefield-standard-text-content);
152
- }
153
- .eds-date-and-time-field__segment--dot-separator {
154
- margin-left: -0.1rem;
155
- margin-right: -0.2rem;
156
- }
157
- .eds-date-and-time-field__segment:focus-visible {
158
- background-color: var(--components-button-iconbutton-standard-active);
159
- outline: transparent;
160
- border-radius: 0.0625rem;
161
- }
162
- .eds-date-and-time-field__segment[aria-valuemax="9999"] {
163
- min-width: 4ch;
164
- }
165
- /* DO NOT CHANGE!*/
166
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
167
167
  .eds-datefield {
168
168
  width: -moz-fit-content;
169
169
  width: fit-content;
@@ -224,6 +224,12 @@
224
224
  padding-left: 1rem;
225
225
  padding-right: 1rem;
226
226
  }
227
+ .eds-timepicker .eds-form-control__prepend {
228
+ margin-right: 0.25rem;
229
+ }
230
+ .eds-timepicker .eds-form-control__append {
231
+ margin-left: 0.25rem;
232
+ }
227
233
  .eds-timepicker .eds-form-control-wrapper {
228
234
  padding: 0rem;
229
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/datepicker",
3
- "version": "10.1.2",
3
+ "version": "11.0.0",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/datepicker.esm.js",
@@ -27,15 +27,15 @@
27
27
  "react-dom": ">=16.8.0"
28
28
  },
29
29
  "dependencies": {
30
- "@entur/a11y": "^0.2.96",
31
- "@entur/button": "^3.3.2",
32
- "@entur/form": "^8.2.2",
33
- "@entur/icons": "^7.7.0",
34
- "@entur/modal": "^1.7.62",
35
- "@entur/tokens": "^3.17.6",
36
- "@entur/tooltip": "^5.2.2",
37
- "@entur/typography": "^1.9.2",
38
- "@entur/utils": "^0.12.2",
30
+ "@entur/a11y": "^0.2.98",
31
+ "@entur/button": "^3.3.4",
32
+ "@entur/form": "^8.2.4",
33
+ "@entur/icons": "^7.8.0",
34
+ "@entur/modal": "^1.7.64",
35
+ "@entur/tokens": "^3.19.0",
36
+ "@entur/tooltip": "^5.2.4",
37
+ "@entur/typography": "^1.9.4",
38
+ "@entur/utils": "^0.12.3",
39
39
  "@floating-ui/react-dom": "^2.1.0",
40
40
  "@internationalized/date": "^3.4.0",
41
41
  "@react-aria/button": "^3.6.4",
@@ -51,5 +51,5 @@
51
51
  "@react-types/datepicker": "^3.9.0",
52
52
  "dts-cli": "2.0.5"
53
53
  },
54
- "gitHead": "7c03f458e9c34f5e0fd4f2d23c8eb6a6e47fb669"
54
+ "gitHead": "bfd8f62e4735cc13d55e50bc8747535d72aaf679"
55
55
  }