@norges-domstoler/dds-components 0.0.0-dev-20240117123110 → 0.0.0-dev-20240117135928
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/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2305,20 +2305,36 @@ declare namespace Calendar {
|
|
|
2305
2305
|
type DateFieldProps<T extends DateValue$1 = CalendarDate> = AriaDateFieldOptions<T> & {
|
|
2306
2306
|
className?: string;
|
|
2307
2307
|
buttonProps?: ReturnType<typeof useDatePicker>['buttonProps'];
|
|
2308
|
+
/**
|
|
2309
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2310
|
+
*/
|
|
2311
|
+
width?: CSS.Properties['width'];
|
|
2308
2312
|
} & Pick<InputProps$1, 'componentSize' | 'errorMessage' | 'tip' | 'disabled' | 'style'>;
|
|
2309
2313
|
|
|
2310
2314
|
interface DatePickerProps extends Omit<AriaDatePickerProps<CalendarDate>, 'granularity'>, Pick<DateFieldProps<CalendarDate>, 'componentSize' | 'tip' | 'style'> {
|
|
2311
2315
|
label?: string;
|
|
2312
2316
|
errorMessage?: string;
|
|
2317
|
+
/**
|
|
2318
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2319
|
+
*/
|
|
2320
|
+
width?: CSS.Properties['width'];
|
|
2313
2321
|
}
|
|
2314
2322
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLElement>>;
|
|
2315
2323
|
|
|
2316
2324
|
type TimePickerProps = Omit<AriaTimeFieldProps<Time>, 'hideTimeZone'> & {
|
|
2317
2325
|
className?: string;
|
|
2318
|
-
|
|
2326
|
+
/**
|
|
2327
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2328
|
+
*/
|
|
2329
|
+
width?: CSS.Properties['width'];
|
|
2330
|
+
} & Pick<InputProps, 'componentSize' | 'errorMessage' | 'tip' | 'disabled' | 'style'>;
|
|
2319
2331
|
declare const TimePicker: react.ForwardRefExoticComponent<Omit<AriaTimeFieldProps<Time>, "hideTimeZone"> & {
|
|
2320
2332
|
className?: string | undefined;
|
|
2321
|
-
|
|
2333
|
+
/**
|
|
2334
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2335
|
+
*/
|
|
2336
|
+
width?: CSS.Properties['width'];
|
|
2337
|
+
} & Pick<InputProps, "style" | "disabled" | "tip" | "errorMessage" | "componentSize"> & react.RefAttributes<HTMLDivElement>>;
|
|
2322
2338
|
|
|
2323
2339
|
declare function nativeDateToDateValue(date: Date, timeZone?: string | undefined): DateValue$1;
|
|
2324
2340
|
declare function dateValueToNativeDate(date: DateValue$1, timeZone?: string | undefined): Date;
|
package/dist/index.d.ts
CHANGED
|
@@ -2305,20 +2305,36 @@ declare namespace Calendar {
|
|
|
2305
2305
|
type DateFieldProps<T extends DateValue$1 = CalendarDate> = AriaDateFieldOptions<T> & {
|
|
2306
2306
|
className?: string;
|
|
2307
2307
|
buttonProps?: ReturnType<typeof useDatePicker>['buttonProps'];
|
|
2308
|
+
/**
|
|
2309
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2310
|
+
*/
|
|
2311
|
+
width?: CSS.Properties['width'];
|
|
2308
2312
|
} & Pick<InputProps$1, 'componentSize' | 'errorMessage' | 'tip' | 'disabled' | 'style'>;
|
|
2309
2313
|
|
|
2310
2314
|
interface DatePickerProps extends Omit<AriaDatePickerProps<CalendarDate>, 'granularity'>, Pick<DateFieldProps<CalendarDate>, 'componentSize' | 'tip' | 'style'> {
|
|
2311
2315
|
label?: string;
|
|
2312
2316
|
errorMessage?: string;
|
|
2317
|
+
/**
|
|
2318
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2319
|
+
*/
|
|
2320
|
+
width?: CSS.Properties['width'];
|
|
2313
2321
|
}
|
|
2314
2322
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLElement>>;
|
|
2315
2323
|
|
|
2316
2324
|
type TimePickerProps = Omit<AriaTimeFieldProps<Time>, 'hideTimeZone'> & {
|
|
2317
2325
|
className?: string;
|
|
2318
|
-
|
|
2326
|
+
/**
|
|
2327
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2328
|
+
*/
|
|
2329
|
+
width?: CSS.Properties['width'];
|
|
2330
|
+
} & Pick<InputProps, 'componentSize' | 'errorMessage' | 'tip' | 'disabled' | 'style'>;
|
|
2319
2331
|
declare const TimePicker: react.ForwardRefExoticComponent<Omit<AriaTimeFieldProps<Time>, "hideTimeZone"> & {
|
|
2320
2332
|
className?: string | undefined;
|
|
2321
|
-
|
|
2333
|
+
/**
|
|
2334
|
+
* For å sette en egendefinert bredde på komponenten.
|
|
2335
|
+
*/
|
|
2336
|
+
width?: CSS.Properties['width'];
|
|
2337
|
+
} & Pick<InputProps, "style" | "disabled" | "tip" | "errorMessage" | "componentSize"> & react.RefAttributes<HTMLDivElement>>;
|
|
2322
2338
|
|
|
2323
2339
|
declare function nativeDateToDateValue(date: Date, timeZone?: string | undefined): DateValue$1;
|
|
2324
2340
|
declare function dateValueToNativeDate(date: DateValue$1, timeZone?: string | undefined): Date;
|
package/dist/index.js
CHANGED
|
@@ -10897,7 +10897,11 @@ var DateFieldContainer = import_styled_components72.default.div`
|
|
|
10897
10897
|
var InputDiv = (0, import_styled_components72.default)(StatefulInput).attrs({
|
|
10898
10898
|
as: "div"
|
|
10899
10899
|
})`
|
|
10900
|
-
|
|
10900
|
+
${({ $width, componentSize = "medium" }) => $width ? import_styled_components72.css`
|
|
10901
|
+
width: ${$width};
|
|
10902
|
+
` : import_styled_components72.css`
|
|
10903
|
+
min-width: ${datePickerTokens.datefield[componentSize].minWidth};
|
|
10904
|
+
`}
|
|
10901
10905
|
display: inline-flex;
|
|
10902
10906
|
flex-direction: row;
|
|
10903
10907
|
gap: ${datePickerTokens.gap};
|
|
@@ -10925,6 +10929,7 @@ var DateInput = (0, import_react81.forwardRef)(
|
|
|
10925
10929
|
prefix: button3,
|
|
10926
10930
|
labelProps,
|
|
10927
10931
|
fieldProps,
|
|
10932
|
+
width,
|
|
10928
10933
|
...props
|
|
10929
10934
|
}, forwardedRef) => {
|
|
10930
10935
|
var _a;
|
|
@@ -10938,6 +10943,7 @@ var DateInput = (0, import_react81.forwardRef)(
|
|
|
10938
10943
|
InputDiv,
|
|
10939
10944
|
{
|
|
10940
10945
|
...fieldProps,
|
|
10946
|
+
$width: width,
|
|
10941
10947
|
style,
|
|
10942
10948
|
disabled,
|
|
10943
10949
|
componentSize,
|
|
@@ -11107,7 +11113,7 @@ var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
|
11107
11113
|
var refIsFocusable = (ref) => {
|
|
11108
11114
|
return typeof ref === "object" && ref !== null && "focus" in ref;
|
|
11109
11115
|
};
|
|
11110
|
-
function _DatePicker({ errorMessage, componentSize, tip, style, ...props }, forwardedRef) {
|
|
11116
|
+
function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props }, forwardedRef) {
|
|
11111
11117
|
const state = (0, import_datepicker4.useDatePickerState)(props);
|
|
11112
11118
|
const domRef = useFocusManagerRef(
|
|
11113
11119
|
refIsFocusable(import_react85.forwardRef) ? forwardedRef : null
|
|
@@ -11131,7 +11137,8 @@ function _DatePicker({ errorMessage, componentSize, tip, style, ...props }, forw
|
|
|
11131
11137
|
errorMessage,
|
|
11132
11138
|
buttonProps,
|
|
11133
11139
|
isOpen: state.isOpen,
|
|
11134
|
-
style
|
|
11140
|
+
style,
|
|
11141
|
+
width
|
|
11135
11142
|
}
|
|
11136
11143
|
) }),
|
|
11137
11144
|
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(CalendarPopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Calendar, { ...calendarProps }) })
|
|
@@ -11151,7 +11158,7 @@ var TimePickerIcon = (0, import_styled_components74.default)(Icon)`
|
|
|
11151
11158
|
width: ${({ $componentSize }) => datePickerTokens.calendarButton[$componentSize].size};
|
|
11152
11159
|
margin-left: -1px; // To align with TextInputs icons
|
|
11153
11160
|
`;
|
|
11154
|
-
function _TimePicker({ componentSize = "medium", ...props }, forwardedRef) {
|
|
11161
|
+
function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef) {
|
|
11155
11162
|
const ref = (0, import_react86.useRef)(null);
|
|
11156
11163
|
const state = (0, import_datepicker7.useTimeFieldState)({
|
|
11157
11164
|
...props,
|
|
@@ -11167,6 +11174,7 @@ function _TimePicker({ componentSize = "medium", ...props }, forwardedRef) {
|
|
|
11167
11174
|
DateInput,
|
|
11168
11175
|
{
|
|
11169
11176
|
...props,
|
|
11177
|
+
width,
|
|
11170
11178
|
disabled,
|
|
11171
11179
|
required: props.isRequired,
|
|
11172
11180
|
componentSize,
|