@norges-domstoler/dds-components 0.0.0-dev-20260911104406 → 0.0.0-dev-20260923130942
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.cjs +25 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +0 -1
- package/dist/index.d.cts +10734 -835
- package/dist/index.d.mts +10734 -835
- package/dist/index.mjs +25 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -18
package/dist/index.cjs
CHANGED
|
@@ -6412,19 +6412,15 @@ const texts$22 = createTexts({
|
|
|
6412
6412
|
function DateSegment({ segment, state, componentSize, errorMessageId, tipId }) {
|
|
6413
6413
|
const ref = (0, react.useRef)(null);
|
|
6414
6414
|
const { segmentProps } = (0, _react_aria_datepicker.useDateSegment)(segment, state, ref);
|
|
6415
|
+
const isSeparator = segment.type === "literal";
|
|
6415
6416
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
|
|
6416
6417
|
...segmentProps,
|
|
6417
|
-
padding: "0 0.05rem",
|
|
6418
|
-
width: "max-content",
|
|
6419
|
-
height: "max-content",
|
|
6420
6418
|
marginBlock: "auto",
|
|
6419
|
+
marginInline: isSeparator ? "-0.15ch" : void 0,
|
|
6421
6420
|
"aria-describedby": spaceSeparatedIdListGenerator([errorMessageId ? errorMessageId : void 0, tipId ? tipId : void 0]),
|
|
6422
6421
|
ref,
|
|
6423
6422
|
className: cn(segmentProps.className, DateInput_module_default.segment, typographyStyles_module_default[`body-short-${componentSize}`]),
|
|
6424
|
-
style: {
|
|
6425
|
-
...segmentProps.style,
|
|
6426
|
-
minWidth: segment.maxValue != null ? String(segment.maxValue).length + "ch" : void 0
|
|
6427
|
-
},
|
|
6423
|
+
style: { ...segmentProps.style },
|
|
6428
6424
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6429
6425
|
"aria-hidden": "true",
|
|
6430
6426
|
className: cn(DateInput_module_default.segment__placeholder, !segment.isPlaceholder && DateInput_module_default["segment__placeholder--invisible"]),
|
|
@@ -9508,15 +9504,23 @@ const getCustomStyles = (size, hasError, isReadOnly) => ({
|
|
|
9508
9504
|
//#endregion
|
|
9509
9505
|
//#region src/components/Select/SelectComponents.tsx
|
|
9510
9506
|
const { Option, NoOptionsMessage, Input, SingleValue, ClearIndicator, DropdownIndicator, MultiValueRemove, Control } = react_select.components;
|
|
9511
|
-
const DDSOption = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Option, {
|
|
9507
|
+
const DDSOption = ({ testId, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Option, {
|
|
9512
9508
|
...props,
|
|
9509
|
+
innerProps: {
|
|
9510
|
+
...props.innerProps,
|
|
9511
|
+
"data-testid": testId
|
|
9512
|
+
},
|
|
9513
9513
|
children: [props.isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
9514
9514
|
icon: CheckIcon,
|
|
9515
9515
|
iconSize: "small"
|
|
9516
9516
|
}), props.children]
|
|
9517
9517
|
});
|
|
9518
|
-
const CustomOption = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Option, {
|
|
9518
|
+
const CustomOption = ({ testId, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Option, {
|
|
9519
9519
|
...props,
|
|
9520
|
+
innerProps: {
|
|
9521
|
+
...props.innerProps,
|
|
9522
|
+
"data-testid": testId
|
|
9523
|
+
},
|
|
9520
9524
|
children: react.default.createElement(props.customElement, props)
|
|
9521
9525
|
});
|
|
9522
9526
|
const CustomSingleValue = ({ id, Element, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SingleValue, {
|
|
@@ -9629,12 +9633,21 @@ function Select({ id, label, componentSize = "medium", errorMessage, tip, "aria-
|
|
|
9629
9633
|
dataTestId
|
|
9630
9634
|
]);
|
|
9631
9635
|
const customOptionComponent = (0, react.useCallback)((props) => {
|
|
9636
|
+
const optionTestId = dataTestId ? `${dataTestId}-option-${String(rest.getOptionValue?.(props.data) ?? props.data.value)}` : void 0;
|
|
9632
9637
|
if (customOptionElement) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomOption, {
|
|
9633
9638
|
...props,
|
|
9634
|
-
customElement: customOptionElement
|
|
9639
|
+
customElement: customOptionElement,
|
|
9640
|
+
testId: optionTestId
|
|
9635
9641
|
});
|
|
9636
|
-
else return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DDSOption, {
|
|
9637
|
-
|
|
9642
|
+
else return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DDSOption, {
|
|
9643
|
+
...props,
|
|
9644
|
+
testId: optionTestId
|
|
9645
|
+
});
|
|
9646
|
+
}, [
|
|
9647
|
+
customOptionElement,
|
|
9648
|
+
dataTestId,
|
|
9649
|
+
rest.getOptionValue
|
|
9650
|
+
]);
|
|
9638
9651
|
const reactSelectProps = {
|
|
9639
9652
|
options,
|
|
9640
9653
|
value,
|