@norges-domstoler/dds-components 21.18.0 → 21.19.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.
- package/dist/index.css +76 -46
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +40 -29
- package/dist/index.d.ts +40 -29
- package/dist/index.js +168 -109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -156
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1444,6 +1444,7 @@ var layout_default = {
|
|
|
1444
1444
|
"dds-o-y": "layout_dds-o-y",
|
|
1445
1445
|
"dds-display": "layout_dds-display",
|
|
1446
1446
|
"dds-text-align": "layout_dds-text-align",
|
|
1447
|
+
"dds-word-break": "layout_dds-word-break",
|
|
1447
1448
|
"dds-flex-dir": "layout_dds-flex-dir",
|
|
1448
1449
|
"dds-gap": "layout_dds-gap",
|
|
1449
1450
|
"dds-c-gap": "layout_dds-c-gap",
|
|
@@ -5344,7 +5345,6 @@ function convertBooleanishToBoolean(value) {
|
|
|
5344
5345
|
// src/components/InputMessage/InputMessage.module.css
|
|
5345
5346
|
var InputMessage_default = {
|
|
5346
5347
|
container: "InputMessage_container",
|
|
5347
|
-
"container--error": "InputMessage_container--error",
|
|
5348
5348
|
icon: "InputMessage_icon"
|
|
5349
5349
|
};
|
|
5350
5350
|
|
|
@@ -5360,41 +5360,72 @@ var InputMessage = ({
|
|
|
5360
5360
|
...rest
|
|
5361
5361
|
}) => {
|
|
5362
5362
|
const isError = messageType === "error";
|
|
5363
|
-
|
|
5364
|
-
"
|
|
5363
|
+
const commonProps = {
|
|
5364
|
+
display: "flex",
|
|
5365
|
+
width: "fit-content",
|
|
5366
|
+
maxWidth: "100%",
|
|
5367
|
+
wordBreak: "break-word",
|
|
5368
|
+
...getBaseHTMLProps(id, cn(className, InputMessage_default.container), htmlProps, rest)
|
|
5369
|
+
};
|
|
5370
|
+
const tgCommonProps = {
|
|
5371
|
+
as: "span",
|
|
5372
|
+
children: message != null ? message : children
|
|
5373
|
+
};
|
|
5374
|
+
return isError ? /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
5375
|
+
Paper,
|
|
5365
5376
|
{
|
|
5366
|
-
...
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
),
|
|
5377
|
+
...commonProps,
|
|
5378
|
+
gap: "x0.25",
|
|
5379
|
+
padding: "x0.25 x0.5",
|
|
5380
|
+
background: "surface-danger-default",
|
|
5381
|
+
borderRadius: "surface",
|
|
5372
5382
|
children: [
|
|
5373
|
-
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
5384
|
+
Icon,
|
|
5385
|
+
{
|
|
5386
|
+
icon: ErrorIcon,
|
|
5387
|
+
iconSize: "small",
|
|
5388
|
+
className: InputMessage_default.icon,
|
|
5389
|
+
color: "icon-on-danger-default"
|
|
5390
|
+
}
|
|
5391
|
+
),
|
|
5374
5392
|
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
5375
5393
|
Typography,
|
|
5376
5394
|
{
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
children: message != null ? message : children
|
|
5395
|
+
...tgCommonProps,
|
|
5396
|
+
typographyType: "bodySmall",
|
|
5397
|
+
color: "textDefault"
|
|
5381
5398
|
}
|
|
5382
5399
|
)
|
|
5383
5400
|
]
|
|
5384
5401
|
}
|
|
5385
|
-
)
|
|
5402
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(Box, { ...commonProps, children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
5403
|
+
Typography,
|
|
5404
|
+
{
|
|
5405
|
+
...tgCommonProps,
|
|
5406
|
+
typographyType: "bodyXsmall",
|
|
5407
|
+
color: "textSubtle"
|
|
5408
|
+
}
|
|
5409
|
+
) });
|
|
5386
5410
|
};
|
|
5387
5411
|
InputMessage.displayName = "InputMessage";
|
|
5388
|
-
var renderInputMessage = (
|
|
5389
|
-
|
|
5412
|
+
var renderInputMessage = ({
|
|
5413
|
+
tip,
|
|
5414
|
+
tipId,
|
|
5415
|
+
errorMessage,
|
|
5416
|
+
errorMessageId,
|
|
5417
|
+
noSpacing
|
|
5418
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(import_jsx_runtime213.Fragment, { children: [
|
|
5419
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
5390
5420
|
InputMessage,
|
|
5391
5421
|
{
|
|
5392
5422
|
message: errorMessage,
|
|
5393
5423
|
messageType: "error",
|
|
5394
|
-
id: errorMessageId
|
|
5424
|
+
id: errorMessageId,
|
|
5425
|
+
marginBlock: !noSpacing ? "x0.125 0" : void 0
|
|
5395
5426
|
}
|
|
5396
5427
|
),
|
|
5397
|
-
tip &&
|
|
5428
|
+
tip && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(InputMessage, { message: tip, messageType: "tip", id: tipId })
|
|
5398
5429
|
] });
|
|
5399
5430
|
|
|
5400
5431
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
@@ -5446,7 +5477,7 @@ var CheckboxGroup = (props) => {
|
|
|
5446
5477
|
readOnly,
|
|
5447
5478
|
showRequiredStyling
|
|
5448
5479
|
}),
|
|
5449
|
-
renderInputMessage(tip, tipId),
|
|
5480
|
+
renderInputMessage({ tip, tipId }),
|
|
5450
5481
|
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(CheckboxGroupContext, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
5451
5482
|
"div",
|
|
5452
5483
|
{
|
|
@@ -5457,7 +5488,7 @@ var CheckboxGroup = (props) => {
|
|
|
5457
5488
|
children
|
|
5458
5489
|
}
|
|
5459
5490
|
) }),
|
|
5460
|
-
renderInputMessage(
|
|
5491
|
+
renderInputMessage({ errorMessage, errorMessageId })
|
|
5461
5492
|
]
|
|
5462
5493
|
}
|
|
5463
5494
|
);
|
|
@@ -5638,7 +5669,7 @@ var RadioButtonGroup = ({
|
|
|
5638
5669
|
readOnly,
|
|
5639
5670
|
showRequiredStyling
|
|
5640
5671
|
}),
|
|
5641
|
-
renderInputMessage(tip, tipId),
|
|
5672
|
+
renderInputMessage({ tip, tipId }),
|
|
5642
5673
|
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(RadioButtonGroupContext, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
5643
5674
|
"div",
|
|
5644
5675
|
{
|
|
@@ -5650,7 +5681,7 @@ var RadioButtonGroup = ({
|
|
|
5650
5681
|
children
|
|
5651
5682
|
}
|
|
5652
5683
|
) }),
|
|
5653
|
-
renderInputMessage(
|
|
5684
|
+
renderInputMessage({ errorMessage, errorMessageId })
|
|
5654
5685
|
]
|
|
5655
5686
|
}
|
|
5656
5687
|
);
|
|
@@ -5800,7 +5831,7 @@ var CardSelectableGroup = ({
|
|
|
5800
5831
|
);
|
|
5801
5832
|
return hasErrorMessage ? /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)("div", { children: [
|
|
5802
5833
|
mainContent,
|
|
5803
|
-
renderInputMessage(
|
|
5834
|
+
renderInputMessage({ errorMessage, errorMessageId })
|
|
5804
5835
|
] }) : mainContent;
|
|
5805
5836
|
};
|
|
5806
5837
|
CardSelectableGroup.displayName = "CardSelectableGroup";
|
|
@@ -6058,9 +6089,8 @@ var DateInput_default = {
|
|
|
6058
6089
|
"segment__placeholder--invisible": "DateInput_segment__placeholder--invisible",
|
|
6059
6090
|
"clear-button": "DateInput_clear-button",
|
|
6060
6091
|
"clear-button--inactive": "DateInput_clear-button--inactive",
|
|
6061
|
-
icon: "DateInput_icon",
|
|
6062
|
-
"popover-button": "DateInput_popover-button",
|
|
6063
6092
|
"icon-wrapper--disabled": "DateInput_icon-wrapper--disabled",
|
|
6093
|
+
"popover-button": "DateInput_popover-button",
|
|
6064
6094
|
"icon-wrapper--readonly": "DateInput_icon-wrapper--readonly",
|
|
6065
6095
|
"popover-button--readonly": "DateInput_popover-button--readonly",
|
|
6066
6096
|
popover: "DateInput_popover",
|
|
@@ -6641,6 +6671,36 @@ var InlineIconButton = ({
|
|
|
6641
6671
|
);
|
|
6642
6672
|
InlineIconButton.displayName = "InlineIconButton";
|
|
6643
6673
|
|
|
6674
|
+
// src/components/helpers/Input/Input.module.css
|
|
6675
|
+
var Input_default = {
|
|
6676
|
+
container: "Input_container",
|
|
6677
|
+
"input-group": "Input_input-group",
|
|
6678
|
+
input: "Input_input",
|
|
6679
|
+
disabled: "Input_disabled",
|
|
6680
|
+
"read-only": "Input_read-only",
|
|
6681
|
+
"input--stateful": "Input_input--stateful",
|
|
6682
|
+
"input--hover": "Input_input--hover",
|
|
6683
|
+
"input--stateful-danger": "Input_input--stateful-danger",
|
|
6684
|
+
"input--large": "Input_input--large",
|
|
6685
|
+
"input--medium": "Input_input--medium",
|
|
6686
|
+
"input--small": "Input_input--small",
|
|
6687
|
+
"input--xsmall": "Input_input--xsmall",
|
|
6688
|
+
"input-with-icon--large": "Input_input-with-icon--large",
|
|
6689
|
+
"input-with-icon--medium": "Input_input-with-icon--medium",
|
|
6690
|
+
"input-with-icon--small": "Input_input-with-icon--small",
|
|
6691
|
+
"input-with-icon--xsmall": "Input_input-with-icon--xsmall",
|
|
6692
|
+
"input-with-el-right--large": "Input_input-with-el-right--large",
|
|
6693
|
+
"input-with-el-right--medium": "Input_input-with-el-right--medium",
|
|
6694
|
+
"input-with-el-right--small": "Input_input-with-el-right--small",
|
|
6695
|
+
"input-with-el-right--xsmall": "Input_input-with-el-right--xsmall",
|
|
6696
|
+
"input--with-affix": "Input_input--with-affix",
|
|
6697
|
+
"input-group__absolute-el": "Input_input-group__absolute-el",
|
|
6698
|
+
"input-group__absolute-el--large": "Input_input-group__absolute-el--large",
|
|
6699
|
+
"input-group__absolute-el--medium": "Input_input-group__absolute-el--medium",
|
|
6700
|
+
"input-group__absolute-el--small": "Input_input-group__absolute-el--small",
|
|
6701
|
+
"input-group__absolute-el--xsmall": "Input_input-group__absolute-el--xsmall"
|
|
6702
|
+
};
|
|
6703
|
+
|
|
6644
6704
|
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
6645
6705
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
6646
6706
|
function CalendarButton({
|
|
@@ -6660,7 +6720,9 @@ function CalendarButton({
|
|
|
6660
6720
|
buttonProps.className,
|
|
6661
6721
|
DateInput_default["popover-button"],
|
|
6662
6722
|
isReadOnly && DateInput_default["popover-button--readonly"],
|
|
6663
|
-
!props.isDisabled && focusable
|
|
6723
|
+
!props.isDisabled && focusable,
|
|
6724
|
+
Input_default["input-group__absolute-el"],
|
|
6725
|
+
Input_default[`input-group__absolute-el--${componentSize}`]
|
|
6664
6726
|
),
|
|
6665
6727
|
icon: CalendarIcon,
|
|
6666
6728
|
size: getFormInputIconSize(componentSize)
|
|
@@ -6737,7 +6799,9 @@ var typographyTypes = {
|
|
|
6737
6799
|
function DateSegment({
|
|
6738
6800
|
segment,
|
|
6739
6801
|
state,
|
|
6740
|
-
componentSize
|
|
6802
|
+
componentSize,
|
|
6803
|
+
errorMessageId,
|
|
6804
|
+
tipId
|
|
6741
6805
|
}) {
|
|
6742
6806
|
const ref = (0, import_react43.useRef)(null);
|
|
6743
6807
|
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment, state, ref);
|
|
@@ -6745,6 +6809,10 @@ function DateSegment({
|
|
|
6745
6809
|
"div",
|
|
6746
6810
|
{
|
|
6747
6811
|
...segmentProps,
|
|
6812
|
+
"aria-describedby": spaceSeparatedIdListGenerator([
|
|
6813
|
+
errorMessageId ? errorMessageId : void 0,
|
|
6814
|
+
tipId ? tipId : void 0
|
|
6815
|
+
]),
|
|
6748
6816
|
ref,
|
|
6749
6817
|
className: cn(
|
|
6750
6818
|
segmentProps.className,
|
|
@@ -6795,23 +6863,6 @@ ClearButton.displayName = "ClearButton";
|
|
|
6795
6863
|
// src/components/date-inputs/common/DateInput.tsx
|
|
6796
6864
|
var import_react44 = require("react");
|
|
6797
6865
|
|
|
6798
|
-
// src/components/helpers/Input/Input.module.css
|
|
6799
|
-
var Input_default = {
|
|
6800
|
-
container: "Input_container",
|
|
6801
|
-
"input-group": "Input_input-group",
|
|
6802
|
-
input: "Input_input",
|
|
6803
|
-
disabled: "Input_disabled",
|
|
6804
|
-
"read-only": "Input_read-only",
|
|
6805
|
-
"input--stateful": "Input_input--stateful",
|
|
6806
|
-
"input--hover": "Input_input--hover",
|
|
6807
|
-
"input--stateful-danger": "Input_input--stateful-danger",
|
|
6808
|
-
"input--medium": "Input_input--medium",
|
|
6809
|
-
"input--small": "Input_input--small",
|
|
6810
|
-
"input--xsmall": "Input_input--xsmall",
|
|
6811
|
-
"input--with-affix": "Input_input--with-affix",
|
|
6812
|
-
"input-group__absolute-element": "Input_input-group__absolute-element"
|
|
6813
|
-
};
|
|
6814
|
-
|
|
6815
6866
|
// src/components/helpers/Input/Input.tsx
|
|
6816
6867
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
6817
6868
|
var Input = ({
|
|
@@ -6895,12 +6946,11 @@ function DateInput({
|
|
|
6895
6946
|
clearable,
|
|
6896
6947
|
ref,
|
|
6897
6948
|
afterLabelContent,
|
|
6949
|
+
tipId,
|
|
6950
|
+
errorMessageId,
|
|
6898
6951
|
...props
|
|
6899
6952
|
}) {
|
|
6900
|
-
var _a;
|
|
6901
6953
|
const hasErrorMessage = !!errorMessage;
|
|
6902
|
-
const hasTip = !!tip;
|
|
6903
|
-
const hasMessage = hasErrorMessage || hasTip;
|
|
6904
6954
|
const { isOpen } = (0, import_react44.useContext)(CalendarPopoverContext);
|
|
6905
6955
|
return /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
6906
6956
|
"div",
|
|
@@ -6926,6 +6976,7 @@ function DateInput({
|
|
|
6926
6976
|
Input_default["input--stateful"],
|
|
6927
6977
|
Input_default["input--hover"],
|
|
6928
6978
|
Input_default[`input--${componentSize}`],
|
|
6979
|
+
Input_default[`input-with-icon--${componentSize}`],
|
|
6929
6980
|
hasErrorMessage && Input_default["input--stateful-danger"],
|
|
6930
6981
|
DateInput_default["date-input"],
|
|
6931
6982
|
clearable && DateInput_default[`date-input--${componentSize}--clearable`],
|
|
@@ -6952,13 +7003,7 @@ function DateInput({
|
|
|
6952
7003
|
]
|
|
6953
7004
|
}
|
|
6954
7005
|
),
|
|
6955
|
-
|
|
6956
|
-
InputMessage,
|
|
6957
|
-
{
|
|
6958
|
-
messageType: hasErrorMessage ? "error" : "tip",
|
|
6959
|
-
message: (_a = errorMessage != null ? errorMessage : tip) != null ? _a : ""
|
|
6960
|
-
}
|
|
6961
|
-
)
|
|
7006
|
+
renderInputMessage({ tip, errorMessage, tipId, errorMessageId })
|
|
6962
7007
|
]
|
|
6963
7008
|
}
|
|
6964
7009
|
);
|
|
@@ -6973,6 +7018,8 @@ function DateField({
|
|
|
6973
7018
|
groupProps,
|
|
6974
7019
|
ref,
|
|
6975
7020
|
clearable,
|
|
7021
|
+
errorMessageId,
|
|
7022
|
+
tipId,
|
|
6976
7023
|
...props
|
|
6977
7024
|
}) {
|
|
6978
7025
|
const { locale } = (0, import_i18n15.useLocale)();
|
|
@@ -7006,6 +7053,8 @@ function DateField({
|
|
|
7006
7053
|
required: props.isRequired,
|
|
7007
7054
|
clearable,
|
|
7008
7055
|
ref,
|
|
7056
|
+
tipId,
|
|
7057
|
+
errorMessageId,
|
|
7009
7058
|
internalRef,
|
|
7010
7059
|
readOnly: props.isReadOnly,
|
|
7011
7060
|
prefix: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
@@ -7038,6 +7087,8 @@ function DateField({
|
|
|
7038
7087
|
{
|
|
7039
7088
|
"aria-readonly": props.isReadOnly,
|
|
7040
7089
|
componentSize,
|
|
7090
|
+
errorMessageId,
|
|
7091
|
+
tipId,
|
|
7041
7092
|
segment,
|
|
7042
7093
|
state
|
|
7043
7094
|
},
|
|
@@ -7095,6 +7146,7 @@ function DatePicker({
|
|
|
7095
7146
|
ref,
|
|
7096
7147
|
...props
|
|
7097
7148
|
}) {
|
|
7149
|
+
var _a;
|
|
7098
7150
|
const lang = useLanguage();
|
|
7099
7151
|
if (!lang) {
|
|
7100
7152
|
throw new Error("DatePicker must be used within a DdsProvider");
|
|
@@ -7108,6 +7160,11 @@ function DatePicker({
|
|
|
7108
7160
|
state,
|
|
7109
7161
|
internalRef
|
|
7110
7162
|
);
|
|
7163
|
+
const hasErrorMessage = !!errorMessage;
|
|
7164
|
+
const hasTip = !!tip;
|
|
7165
|
+
const uniqueId = (_a = props.id) != null ? _a : (0, import_react47.useId)();
|
|
7166
|
+
const errorMessageId = hasErrorMessage ? `${uniqueId}-errorMessage` : void 0;
|
|
7167
|
+
const tipId = hasTip ? `${uniqueId}-tip` : void 0;
|
|
7111
7168
|
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_i18n17.I18nProvider, { locale: LOCALE[lang], children: /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(
|
|
7112
7169
|
CalendarPopover,
|
|
7113
7170
|
{
|
|
@@ -7123,8 +7180,11 @@ function DatePicker({
|
|
|
7123
7180
|
ref: combinedRef,
|
|
7124
7181
|
componentSize,
|
|
7125
7182
|
tip,
|
|
7183
|
+
id: uniqueId,
|
|
7126
7184
|
label: props.label,
|
|
7127
7185
|
errorMessage,
|
|
7186
|
+
errorMessageId,
|
|
7187
|
+
tipId,
|
|
7128
7188
|
buttonProps,
|
|
7129
7189
|
style,
|
|
7130
7190
|
width,
|
|
@@ -7179,6 +7239,7 @@ function TimePicker({
|
|
|
7179
7239
|
ref,
|
|
7180
7240
|
...props
|
|
7181
7241
|
}) {
|
|
7242
|
+
var _a;
|
|
7182
7243
|
const lang = useLanguage();
|
|
7183
7244
|
if (!lang) {
|
|
7184
7245
|
throw new Error("TimePicker must be used within a DdsProvider");
|
|
@@ -7193,6 +7254,11 @@ function TimePicker({
|
|
|
7193
7254
|
state,
|
|
7194
7255
|
internalRef
|
|
7195
7256
|
);
|
|
7257
|
+
const hasErrorMessage = !!props.errorMessage;
|
|
7258
|
+
const hasTip = !!props.tip;
|
|
7259
|
+
const uniqueId = (_a = props.id) != null ? _a : (0, import_react48.useId)();
|
|
7260
|
+
const errorMessageId = hasErrorMessage ? `${uniqueId}-errorMessage` : void 0;
|
|
7261
|
+
const tipId = hasTip ? `${uniqueId}-tip` : void 0;
|
|
7196
7262
|
const iconSize = componentSize === "xsmall" ? "small" : "medium";
|
|
7197
7263
|
const disabled = props.isDisabled || !!fieldProps["aria-disabled"];
|
|
7198
7264
|
const formattedSegments = formatTimeSegments(state.segments);
|
|
@@ -7200,6 +7266,8 @@ function TimePicker({
|
|
|
7200
7266
|
DateInput,
|
|
7201
7267
|
{
|
|
7202
7268
|
...props,
|
|
7269
|
+
errorMessageId,
|
|
7270
|
+
tipId,
|
|
7203
7271
|
width,
|
|
7204
7272
|
disabled,
|
|
7205
7273
|
required: props.isRequired,
|
|
@@ -7215,7 +7283,8 @@ function TimePicker({
|
|
|
7215
7283
|
icon: TimeIcon,
|
|
7216
7284
|
iconSize,
|
|
7217
7285
|
className: cn(
|
|
7218
|
-
|
|
7286
|
+
Input_default["input-group__absolute-el"],
|
|
7287
|
+
Input_default[`input-group__absolute-el--${componentSize}`],
|
|
7219
7288
|
disabled && DateInput_default["icon-wrapper--disabled"],
|
|
7220
7289
|
props.isReadOnly && DateInput_default["icon-wrapper--readonly"]
|
|
7221
7290
|
)
|
|
@@ -7224,6 +7293,8 @@ function TimePicker({
|
|
|
7224
7293
|
children: formattedSegments.map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
7225
7294
|
DateSegment,
|
|
7226
7295
|
{
|
|
7296
|
+
errorMessageId,
|
|
7297
|
+
tipId,
|
|
7227
7298
|
componentSize,
|
|
7228
7299
|
segment,
|
|
7229
7300
|
state
|
|
@@ -7953,7 +8024,7 @@ var TextArea = ({
|
|
|
7953
8024
|
justifyContent: withCharacterCounter ? hasMessage ? "space-between" : "flex-end" : void 0,
|
|
7954
8025
|
width: withCharacterCounter ? inputWidth : void 0,
|
|
7955
8026
|
children: [
|
|
7956
|
-
renderInputMessage(tip, tipId, errorMessage, errorMessageId),
|
|
8027
|
+
renderInputMessage({ tip, tipId, errorMessage, errorMessageId }),
|
|
7957
8028
|
renderCharCounter(
|
|
7958
8029
|
characterCounterId,
|
|
7959
8030
|
withCharacterCounter,
|
|
@@ -8412,14 +8483,10 @@ var ErrorList = (props) => {
|
|
|
8412
8483
|
return null;
|
|
8413
8484
|
}
|
|
8414
8485
|
if (errors.length === 1) {
|
|
8415
|
-
return
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
message: errors[0].message,
|
|
8420
|
-
messageType: "error"
|
|
8421
|
-
}
|
|
8422
|
-
);
|
|
8486
|
+
return renderInputMessage({
|
|
8487
|
+
errorMessage: errors[0].message,
|
|
8488
|
+
errorMessageId: errors[0].id
|
|
8489
|
+
});
|
|
8423
8490
|
}
|
|
8424
8491
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StylelessList, { children: errors.map(({ id, message }) => {
|
|
8425
8492
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
@@ -8967,7 +9034,7 @@ var FileUploader = (props) => {
|
|
|
8967
9034
|
readOnly,
|
|
8968
9035
|
afterLabelContent
|
|
8969
9036
|
}),
|
|
8970
|
-
|
|
9037
|
+
renderInputMessage({ tip, tipId }),
|
|
8971
9038
|
inactive ? input : withDragAndDrop ? /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(
|
|
8972
9039
|
VStack,
|
|
8973
9040
|
{
|
|
@@ -9587,7 +9654,7 @@ function InlineField(props) {
|
|
|
9587
9654
|
renderElement()
|
|
9588
9655
|
] }),
|
|
9589
9656
|
inlineEditVisuallyHidden(descId, emptiable),
|
|
9590
|
-
renderInputMessage(
|
|
9657
|
+
renderInputMessage({ errorMessage, errorMessageId })
|
|
9591
9658
|
] });
|
|
9592
9659
|
}
|
|
9593
9660
|
|
|
@@ -10290,7 +10357,7 @@ var control = {
|
|
|
10290
10357
|
...optionTypography.medium
|
|
10291
10358
|
},
|
|
10292
10359
|
hasIcon: {
|
|
10293
|
-
paddingLeft: "calc(var(--dds-spacing-x0-75) + var(--dds-icon-size-medium) + var(--dds-spacing-
|
|
10360
|
+
paddingLeft: "calc(var(--dds-spacing-x0-75) + var(--dds-icon-size-medium) + var(--dds-spacing-md-icon-text-gap))"
|
|
10294
10361
|
}
|
|
10295
10362
|
},
|
|
10296
10363
|
small: {
|
|
@@ -10300,7 +10367,7 @@ var control = {
|
|
|
10300
10367
|
...optionTypography.small
|
|
10301
10368
|
},
|
|
10302
10369
|
hasIcon: {
|
|
10303
|
-
paddingLeft: "calc(var(--dds-spacing-x0-75) + var(--dds-icon-size-medium) + var(--dds-spacing-
|
|
10370
|
+
paddingLeft: "calc(var(--dds-spacing-x0-75) + var(--dds-icon-size-medium) + var(--dds-spacing-sm-icon-text-gap))"
|
|
10304
10371
|
}
|
|
10305
10372
|
},
|
|
10306
10373
|
xsmall: {
|
|
@@ -10310,7 +10377,7 @@ var control = {
|
|
|
10310
10377
|
...optionTypography.xsmall
|
|
10311
10378
|
},
|
|
10312
10379
|
hasIcon: {
|
|
10313
|
-
paddingLeft: "calc(var(--dds-spacing-x0-5) + var(--dds-icon-size-small) + var(--dds-spacing-
|
|
10380
|
+
paddingLeft: "calc(var(--dds-spacing-x0-5) + var(--dds-icon-size-small) + var(--dds-spacing-xs-icon-text-gap))"
|
|
10314
10381
|
}
|
|
10315
10382
|
}
|
|
10316
10383
|
};
|
|
@@ -10608,7 +10675,7 @@ function DDSControl(props) {
|
|
|
10608
10675
|
icon,
|
|
10609
10676
|
iconSize: getFormInputIconSize(componentSize),
|
|
10610
10677
|
className: cn(
|
|
10611
|
-
Input_default["input-group__absolute-
|
|
10678
|
+
Input_default["input-group__absolute-el"],
|
|
10612
10679
|
Select_default[`icon--${componentSize}`]
|
|
10613
10680
|
)
|
|
10614
10681
|
}
|
|
@@ -10789,7 +10856,7 @@ function Select({
|
|
|
10789
10856
|
afterLabelContent
|
|
10790
10857
|
}),
|
|
10791
10858
|
/* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_react_select2.default, { ...reactSelectProps, ref }),
|
|
10792
|
-
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
10859
|
+
renderInputMessage({ tip, tipId, errorMessage, errorMessageId })
|
|
10793
10860
|
]
|
|
10794
10861
|
}
|
|
10795
10862
|
);
|
|
@@ -10837,6 +10904,7 @@ var NativeSelect = ({
|
|
|
10837
10904
|
clearable,
|
|
10838
10905
|
afterLabelContent,
|
|
10839
10906
|
onChange,
|
|
10907
|
+
icon,
|
|
10840
10908
|
...rest
|
|
10841
10909
|
}) => {
|
|
10842
10910
|
const { t } = useTranslation();
|
|
@@ -10882,6 +10950,7 @@ var NativeSelect = ({
|
|
|
10882
10950
|
};
|
|
10883
10951
|
const iconSize = componentSize === "medium" ? "medium" : "small";
|
|
10884
10952
|
const showClearButton = clearable && hasValue && !readOnly && !rest.disabled;
|
|
10953
|
+
const hasIcon = !!icon;
|
|
10885
10954
|
return /* @__PURE__ */ (0, import_jsx_runtime290.jsxs)("div", { className, style, children: [
|
|
10886
10955
|
renderLabel({
|
|
10887
10956
|
label,
|
|
@@ -10891,6 +10960,17 @@ var NativeSelect = ({
|
|
|
10891
10960
|
afterLabelContent
|
|
10892
10961
|
}),
|
|
10893
10962
|
/* @__PURE__ */ (0, import_jsx_runtime290.jsxs)(Box, { position: "relative", width: inputWidth, children: [
|
|
10963
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(
|
|
10964
|
+
Icon,
|
|
10965
|
+
{
|
|
10966
|
+
icon,
|
|
10967
|
+
className: cn(
|
|
10968
|
+
Input_default["input-group__absolute-el"],
|
|
10969
|
+
Input_default[`input-group__absolute-el--${componentSize}`]
|
|
10970
|
+
),
|
|
10971
|
+
iconSize: getFormInputIconSize(componentSize)
|
|
10972
|
+
}
|
|
10973
|
+
),
|
|
10894
10974
|
/* @__PURE__ */ (0, import_jsx_runtime290.jsx)(
|
|
10895
10975
|
"select",
|
|
10896
10976
|
{
|
|
@@ -10902,6 +10982,7 @@ var NativeSelect = ({
|
|
|
10902
10982
|
readOnly && NativeSelect_default["select--readonly"],
|
|
10903
10983
|
Input_default.input,
|
|
10904
10984
|
Input_default[`input--${componentSize}`],
|
|
10985
|
+
hasIcon && Input_default[`input-with-icon--${componentSize}`],
|
|
10905
10986
|
NativeSelect_default[`select--${componentSize}`],
|
|
10906
10987
|
scrollbar,
|
|
10907
10988
|
focusable,
|
|
@@ -10943,7 +11024,7 @@ var NativeSelect = ({
|
|
|
10943
11024
|
}
|
|
10944
11025
|
)
|
|
10945
11026
|
] }),
|
|
10946
|
-
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
11027
|
+
renderInputMessage({ tip, tipId, errorMessage, errorMessageId })
|
|
10947
11028
|
] });
|
|
10948
11029
|
};
|
|
10949
11030
|
var NativeSelectPlaceholder = ({
|
|
@@ -11898,7 +11979,7 @@ var PhoneInput = ({
|
|
|
11898
11979
|
{
|
|
11899
11980
|
className: cn(
|
|
11900
11981
|
typographyStyles_default[`body-${componentSize}`],
|
|
11901
|
-
Input_default["input-group__absolute-
|
|
11982
|
+
Input_default["input-group__absolute-el"],
|
|
11902
11983
|
PhoneInput_default["calling-code"]
|
|
11903
11984
|
),
|
|
11904
11985
|
ref: callingCodeRef,
|
|
@@ -11935,7 +12016,7 @@ var PhoneInput = ({
|
|
|
11935
12016
|
]
|
|
11936
12017
|
}
|
|
11937
12018
|
),
|
|
11938
|
-
hasMessage && renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
12019
|
+
hasMessage && renderInputMessage({ tip, tipId, errorMessage, errorMessageId })
|
|
11939
12020
|
] });
|
|
11940
12021
|
};
|
|
11941
12022
|
PhoneInput.displayName = "PhoneInput";
|
|
@@ -12558,7 +12639,7 @@ var ProgressBar = ({
|
|
|
12558
12639
|
)
|
|
12559
12640
|
}
|
|
12560
12641
|
),
|
|
12561
|
-
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
12642
|
+
renderInputMessage({ tip, tipId, errorMessage, errorMessageId })
|
|
12562
12643
|
] });
|
|
12563
12644
|
};
|
|
12564
12645
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -12577,7 +12658,6 @@ var useAutocompleteSearch = () => {
|
|
|
12577
12658
|
var Search_default = {
|
|
12578
12659
|
"with-button-container": "Search_with-button-container",
|
|
12579
12660
|
input: "Search_input",
|
|
12580
|
-
"search-icon": "Search_search-icon",
|
|
12581
12661
|
"clear-button": "Search_clear-button",
|
|
12582
12662
|
suggestions: "Search_suggestions"
|
|
12583
12663
|
};
|
|
@@ -12723,29 +12803,10 @@ var getIconSize2 = (size2) => {
|
|
|
12723
12803
|
case "large":
|
|
12724
12804
|
return "medium";
|
|
12725
12805
|
case "medium":
|
|
12726
|
-
return "medium";
|
|
12727
12806
|
case "small":
|
|
12728
|
-
return
|
|
12807
|
+
return getFormInputIconSize(size2);
|
|
12729
12808
|
}
|
|
12730
12809
|
};
|
|
12731
|
-
var getPadding = (size2, showIcon) => {
|
|
12732
|
-
const paddingRight = (textSize) => `calc(
|
|
12733
|
-
var(--dds-spacing-x1) + ${textSize} * 1.5 + var(--dds-spacing-x0-5)
|
|
12734
|
-
)`;
|
|
12735
|
-
const paddingLeft = (iconSize) => `calc(
|
|
12736
|
-
var(--dds-spacing-x0-75) + ${iconSize} + var(--dds-spacing-x0-5)
|
|
12737
|
-
)`;
|
|
12738
|
-
const pRSmallButton = paddingRight("0.875rem");
|
|
12739
|
-
const pRMediumButton = paddingRight("1rem");
|
|
12740
|
-
const pLSmallIcon = paddingLeft("var(--dds-icon-size-small)");
|
|
12741
|
-
const pLMediumIcon = paddingLeft("var(--dds-icon-size-medium)");
|
|
12742
|
-
const paddingMap = {
|
|
12743
|
-
large: `x1 ${pRMediumButton} x1 ${showIcon ? pLMediumIcon : "x0.75"}`,
|
|
12744
|
-
medium: `x0.75 ${pRSmallButton} x0.75 ${showIcon ? pLMediumIcon : "x0.75"}`,
|
|
12745
|
-
small: `x0.5 ${pRSmallButton} x0.5 ${showIcon ? pLSmallIcon : "x0.75"}`
|
|
12746
|
-
};
|
|
12747
|
-
return paddingMap[size2];
|
|
12748
|
-
};
|
|
12749
12810
|
var Search = ({
|
|
12750
12811
|
componentSize = "medium",
|
|
12751
12812
|
buttonProps,
|
|
@@ -12806,8 +12867,8 @@ var Search = ({
|
|
|
12806
12867
|
icon: SearchIcon,
|
|
12807
12868
|
iconSize: getIconSize2(componentSize),
|
|
12808
12869
|
className: cn(
|
|
12809
|
-
Input_default["input-group__absolute-
|
|
12810
|
-
|
|
12870
|
+
Input_default["input-group__absolute-el"],
|
|
12871
|
+
Input_default[`input-group__absolute-el--${componentSize}`]
|
|
12811
12872
|
)
|
|
12812
12873
|
}
|
|
12813
12874
|
),
|
|
@@ -12833,9 +12894,11 @@ var Search = ({
|
|
|
12833
12894
|
"aria-expanded": context.showSuggestions,
|
|
12834
12895
|
role: hasSuggestions ? "combobox" : void 0,
|
|
12835
12896
|
width: "100%",
|
|
12836
|
-
padding: getPadding(componentSize, showIcon),
|
|
12837
12897
|
className: cn(
|
|
12838
12898
|
Search_default.input,
|
|
12899
|
+
Input_default[`input--${componentSize}`],
|
|
12900
|
+
showIcon && Input_default[`input-with-icon--${componentSize}`],
|
|
12901
|
+
Input_default[`input-with-el-right--${componentSize}`],
|
|
12839
12902
|
typographyStyles_default[getTypographyCn(typographyTypes2[componentSize])]
|
|
12840
12903
|
)
|
|
12841
12904
|
}
|
|
@@ -12894,7 +12957,7 @@ var Search = ({
|
|
|
12894
12957
|
]
|
|
12895
12958
|
}
|
|
12896
12959
|
) : inputGroup,
|
|
12897
|
-
renderInputMessage(tip, tipId)
|
|
12960
|
+
renderInputMessage({ tip, tipId })
|
|
12898
12961
|
] })
|
|
12899
12962
|
] });
|
|
12900
12963
|
};
|
|
@@ -13977,10 +14040,6 @@ var TextInput_default = {
|
|
|
13977
14040
|
container: "TextInput_container",
|
|
13978
14041
|
"container--readonly": "TextInput_container--readonly",
|
|
13979
14042
|
"container--disabled": "TextInput_container--disabled",
|
|
13980
|
-
input: "TextInput_input",
|
|
13981
|
-
"with-icon--medium": "TextInput_with-icon--medium",
|
|
13982
|
-
"with-icon--small": "TextInput_with-icon--small",
|
|
13983
|
-
"with-icon--xsmall": "TextInput_with-icon--xsmall",
|
|
13984
14043
|
"input--extended": "TextInput_input--extended",
|
|
13985
14044
|
"icon--medium": "TextInput_icon--medium",
|
|
13986
14045
|
"icon--small": "TextInput_icon--small",
|
|
@@ -14094,7 +14153,8 @@ var TextInput = ({
|
|
|
14094
14153
|
icon,
|
|
14095
14154
|
iconSize: getFormInputIconSize(componentSize),
|
|
14096
14155
|
className: cn(
|
|
14097
|
-
Input_default["input-group__absolute-
|
|
14156
|
+
Input_default["input-group__absolute-el"],
|
|
14157
|
+
Input_default[`input-group__absolute-el--${componentSize}`],
|
|
14098
14158
|
TextInput_default[`icon--${componentSize}`]
|
|
14099
14159
|
)
|
|
14100
14160
|
}
|
|
@@ -14103,8 +14163,7 @@ var TextInput = ({
|
|
|
14103
14163
|
StatefulInput,
|
|
14104
14164
|
{
|
|
14105
14165
|
className: cn(
|
|
14106
|
-
|
|
14107
|
-
TextInput_default[`with-icon--${componentSize}`],
|
|
14166
|
+
Input_default[`input-with-icon--${componentSize}`],
|
|
14108
14167
|
TextInput_default["input--extended"]
|
|
14109
14168
|
),
|
|
14110
14169
|
...generalInputProps
|
|
@@ -14189,7 +14248,7 @@ var TextInput = ({
|
|
|
14189
14248
|
gap: "x0.5",
|
|
14190
14249
|
width: withCharacterCounter ? inputWidth : void 0,
|
|
14191
14250
|
children: [
|
|
14192
|
-
renderInputMessage(tip, tipId, errorMessage, errorMessageId),
|
|
14251
|
+
renderInputMessage({ tip, tipId, errorMessage, errorMessageId }),
|
|
14193
14252
|
renderCharCounter(
|
|
14194
14253
|
characterCounterId,
|
|
14195
14254
|
withCharacterCounter,
|