@atom-learning/components 6.9.0 → 6.10.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/components/form/Form.js +5 -2
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form/useFormCustomContext.d.ts +3 -2
- package/dist/components/form/useFormCustomContext.js.map +1 -1
- package/dist/components/input/Input.d.ts +3 -1
- package/dist/components/input/Input.js +29 -11
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input-field/InputField.d.ts +1 -1
- package/dist/components/input-field/InputField.js +3 -1
- package/dist/components/input-field/InputField.js.map +1 -1
- package/dist/components/number-input/NumberInput.d.ts +1 -0
- package/dist/components/number-input/NumberInput.js +4 -1
- package/dist/components/number-input/NumberInput.js.map +1 -1
- package/dist/components/number-input/NumberInputStepper.d.ts +2 -1
- package/dist/components/number-input/NumberInputStepper.js +23 -10
- package/dist/components/number-input/NumberInputStepper.js.map +1 -1
- package/dist/components/number-input-field/NumberInputField.d.ts +1 -1
- package/dist/components/number-input-field/NumberInputField.js +3 -1
- package/dist/components/number-input-field/NumberInputField.js.map +1 -1
- package/dist/components/password-field/PasswordField.d.ts +1 -1
- package/dist/components/password-field/PasswordField.js +3 -1
- package/dist/components/password-field/PasswordField.js.map +1 -1
- package/dist/components/search-field/SearchField.d.ts +1 -1
- package/dist/components/search-field/SearchField.js +3 -1
- package/dist/components/search-field/SearchField.js.map +1 -1
- package/dist/components/search-input/SearchInput.js +2 -1
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/select/Select.d.ts +2 -1
- package/dist/components/select/Select.js +26 -9
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-field/SelectField.d.ts +1 -1
- package/dist/components/select-field/SelectField.js +3 -1
- package/dist/components/select-field/SelectField.js.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +4 -2
- package/dist/components/textarea/Textarea.js +27 -10
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea-field/TextareaField.d.ts +1 -1
- package/dist/components/textarea-field/TextareaField.js +3 -1
- package/dist/components/textarea-field/TextareaField.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +134 -50
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3315,17 +3315,34 @@ var InputBackground = styled("div", {
|
|
|
3315
3315
|
xl: ["h-16"]
|
|
3316
3316
|
},
|
|
3317
3317
|
disabled: { true: ["cursor-not-allowed", "opacity-30"] },
|
|
3318
|
-
state: { error: [] }
|
|
3318
|
+
state: { error: [] },
|
|
3319
|
+
theme: {
|
|
3320
|
+
white: [],
|
|
3321
|
+
grey: []
|
|
3322
|
+
}
|
|
3319
3323
|
},
|
|
3320
|
-
compoundVariants: [
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3324
|
+
compoundVariants: [
|
|
3325
|
+
{
|
|
3326
|
+
state: "error",
|
|
3327
|
+
appearance: "standard",
|
|
3328
|
+
class: ["border-danger"]
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
state: "error",
|
|
3332
|
+
appearance: "modern",
|
|
3333
|
+
class: ["bg-danger-light", "focus-within:outline-danger"]
|
|
3334
|
+
},
|
|
3335
|
+
{
|
|
3336
|
+
appearance: "modern",
|
|
3337
|
+
theme: "white",
|
|
3338
|
+
class: ["bg-white"]
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
appearance: "modern",
|
|
3342
|
+
theme: "grey",
|
|
3343
|
+
class: ["bg-grey-100"]
|
|
3344
|
+
}
|
|
3345
|
+
]
|
|
3329
3346
|
});
|
|
3330
3347
|
InputBackground.displayName = "InputBackground";
|
|
3331
3348
|
var StyledInputText = styled(Text, { base: [
|
|
@@ -3360,10 +3377,11 @@ var InputText = react.forwardRef(({ type = "text", size, ...rest }, ref) => {
|
|
|
3360
3377
|
});
|
|
3361
3378
|
});
|
|
3362
3379
|
InputText.displayName = "InputText";
|
|
3363
|
-
var Input = react.forwardRef(({ className, size = "md", appearance = "standard", state, disabled, style, ...rest }, ref) => {
|
|
3380
|
+
var Input = react.forwardRef(({ className, size = "md", appearance = "standard", theme, state, disabled, style, ...rest }, ref) => {
|
|
3364
3381
|
return /* @__PURE__ */ react.createElement(InputBackground, {
|
|
3365
3382
|
size,
|
|
3366
3383
|
appearance,
|
|
3384
|
+
theme,
|
|
3367
3385
|
disabled,
|
|
3368
3386
|
state,
|
|
3369
3387
|
className,
|
|
@@ -3409,12 +3427,13 @@ var PasswordInput = react.forwardRef(({ className, hidePasswordText = "Hide pass
|
|
|
3409
3427
|
PasswordInput.displayName = "PasswordInput";
|
|
3410
3428
|
//#endregion
|
|
3411
3429
|
//#region src/components/password-field/PasswordField.tsx
|
|
3412
|
-
var PasswordField = ({ className, hideLabel, label = "Password", name, prompt = void 0, description, validation, appearance, ...remainingProps }) => {
|
|
3430
|
+
var PasswordField = ({ className, hideLabel, label = "Password", name, prompt = void 0, description, validation, appearance, theme, ...remainingProps }) => {
|
|
3413
3431
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
3414
3432
|
const context = useFormCustomContext();
|
|
3415
3433
|
const { error } = useFieldError(name);
|
|
3416
3434
|
const ref = validation ? register(validation) : register;
|
|
3417
3435
|
const formAppearance = context?.appearance || appearance;
|
|
3436
|
+
const formTheme = context?.theme ?? theme;
|
|
3418
3437
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
3419
3438
|
description,
|
|
3420
3439
|
error,
|
|
@@ -3431,6 +3450,7 @@ var PasswordField = ({ className, hideLabel, label = "Password", name, prompt =
|
|
|
3431
3450
|
id: name,
|
|
3432
3451
|
ref,
|
|
3433
3452
|
appearance: formAppearance,
|
|
3453
|
+
theme: formTheme,
|
|
3434
3454
|
...error !== void 0 && { state: "error" },
|
|
3435
3455
|
...remainingProps
|
|
3436
3456
|
}));
|
|
@@ -4339,7 +4359,7 @@ var StyledIcon$1 = styled(Icon, {
|
|
|
4339
4359
|
lg: ["right-2.5", "size-5"]
|
|
4340
4360
|
} }
|
|
4341
4361
|
});
|
|
4342
|
-
var SearchInput = react.forwardRef(({ size = "md", appearance = "standard", className, value, defaultValue = "", onValueChange, clearText = "Clear", onChange, ...remainingProps }, ref) => {
|
|
4362
|
+
var SearchInput = react.forwardRef(({ size = "md", appearance = "standard", theme, className, value, defaultValue = "", onValueChange, clearText = "Clear", onChange, ...remainingProps }, ref) => {
|
|
4343
4363
|
const [inputElRef, setInputElRef] = useCallbackRef();
|
|
4344
4364
|
const [innerValue, setInnerValue] = react.useState(defaultValue);
|
|
4345
4365
|
const [activeIcon, setActiveIcon] = react.useState(defaultValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH);
|
|
@@ -4383,6 +4403,7 @@ var SearchInput = react.forwardRef(({ size = "md", appearance = "standard", clas
|
|
|
4383
4403
|
return /* @__PURE__ */ react.createElement(InputBackground, {
|
|
4384
4404
|
size,
|
|
4385
4405
|
appearance,
|
|
4406
|
+
theme,
|
|
4386
4407
|
className: (0, clsx.default)("relative", "w-auto", className)
|
|
4387
4408
|
}, /* @__PURE__ */ react.createElement(InputText, {
|
|
4388
4409
|
ref: setInputElRef,
|
|
@@ -6114,12 +6135,15 @@ Flex.displayName = "Flex";
|
|
|
6114
6135
|
//#endregion
|
|
6115
6136
|
//#region src/components/form/Form.tsx
|
|
6116
6137
|
var Form = (props) => {
|
|
6117
|
-
const { children, defaultValues, validationMode = "onBlur", onSubmit, onError, appearance, ...rest } = props;
|
|
6138
|
+
const { children, defaultValues, validationMode = "onBlur", onSubmit, onError, appearance, theme, ...rest } = props;
|
|
6118
6139
|
const methods = (0, react_hook_form.useForm)({
|
|
6119
6140
|
defaultValues,
|
|
6120
6141
|
mode: validationMode
|
|
6121
6142
|
});
|
|
6122
|
-
return /* @__PURE__ */ react.createElement(react_hook_form.FormProvider, methods, /* @__PURE__ */ react.createElement(FormCustomContext.Provider, { value: {
|
|
6143
|
+
return /* @__PURE__ */ react.createElement(react_hook_form.FormProvider, methods, /* @__PURE__ */ react.createElement(FormCustomContext.Provider, { value: {
|
|
6144
|
+
appearance,
|
|
6145
|
+
theme
|
|
6146
|
+
} }, /* @__PURE__ */ react.createElement("form", {
|
|
6123
6147
|
"aria-label": "form",
|
|
6124
6148
|
onSubmit: methods.handleSubmit(onSubmit, onError),
|
|
6125
6149
|
...rest
|
|
@@ -6157,12 +6181,13 @@ var Grid = ({ className, style, gap = "2", minItemSize, maxItemSize = "1fr", ...
|
|
|
6157
6181
|
Grid.displayName = "Grid";
|
|
6158
6182
|
//#endregion
|
|
6159
6183
|
//#region src/components/input-field/InputField.tsx
|
|
6160
|
-
var InputField = ({ className, label, name, validation, prompt, description, hideLabel, appearance, ...remainingProps }) => {
|
|
6184
|
+
var InputField = ({ className, label, name, validation, prompt, description, hideLabel, appearance, theme, ...remainingProps }) => {
|
|
6161
6185
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
6162
6186
|
const context = useFormCustomContext();
|
|
6163
6187
|
const { error } = useFieldError(name);
|
|
6164
6188
|
const ref = validation ? register(validation) : register;
|
|
6165
6189
|
const formAppearance = context?.appearance || appearance;
|
|
6190
|
+
const formTheme = context?.theme ?? theme;
|
|
6166
6191
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
6167
6192
|
className,
|
|
6168
6193
|
description,
|
|
@@ -6178,6 +6203,7 @@ var InputField = ({ className, label, name, validation, prompt, description, hid
|
|
|
6178
6203
|
name,
|
|
6179
6204
|
ref,
|
|
6180
6205
|
appearance: formAppearance,
|
|
6206
|
+
theme: formTheme,
|
|
6181
6207
|
...error && { state: "error" },
|
|
6182
6208
|
...remainingProps
|
|
6183
6209
|
}));
|
|
@@ -6910,6 +6936,10 @@ var StyledStepperButton = styled(ActionIcon, {
|
|
|
6910
6936
|
"hover:bg-grey-200!"
|
|
6911
6937
|
]
|
|
6912
6938
|
},
|
|
6939
|
+
fieldTheme: {
|
|
6940
|
+
white: [],
|
|
6941
|
+
grey: []
|
|
6942
|
+
},
|
|
6913
6943
|
emphasis: { bold: [
|
|
6914
6944
|
"[&_svg]:text-primary-700",
|
|
6915
6945
|
"hover:bg-primary-100!",
|
|
@@ -6918,18 +6948,26 @@ var StyledStepperButton = styled(ActionIcon, {
|
|
|
6918
6948
|
"active:[&_svg]:text-primary-900!"
|
|
6919
6949
|
] }
|
|
6920
6950
|
},
|
|
6921
|
-
compoundVariants: [
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6951
|
+
compoundVariants: [
|
|
6952
|
+
{
|
|
6953
|
+
fieldAppearance: "modern",
|
|
6954
|
+
fieldTheme: "white",
|
|
6955
|
+
class: ["bg-white"]
|
|
6956
|
+
},
|
|
6957
|
+
{
|
|
6958
|
+
fieldAppearance: "standard",
|
|
6959
|
+
emphasis: "bold",
|
|
6960
|
+
class: ["bg-white", "border-primary-800!"]
|
|
6961
|
+
},
|
|
6962
|
+
{
|
|
6963
|
+
fieldAppearance: "modern",
|
|
6964
|
+
emphasis: "bold",
|
|
6965
|
+
class: ["bg-white!", "hover:bg-primary-100!"]
|
|
6966
|
+
}
|
|
6967
|
+
]
|
|
6930
6968
|
});
|
|
6931
6969
|
var NumberInputStepper = react.forwardRef((props, forwardedRef) => {
|
|
6932
|
-
const { icon, disabledTooltipContent, showTooltip, fieldAppearance = "standard", ...rest } = props;
|
|
6970
|
+
const { icon, disabledTooltipContent, showTooltip, fieldAppearance = "standard", fieldTheme, ...rest } = props;
|
|
6933
6971
|
/**
|
|
6934
6972
|
* Focus has been removed from the button
|
|
6935
6973
|
* as the increment and decrement buttons should be keyboard accessible via arrow keys.
|
|
@@ -6943,6 +6981,7 @@ var NumberInputStepper = react.forwardRef((props, forwardedRef) => {
|
|
|
6943
6981
|
tabIndex: -1,
|
|
6944
6982
|
appearance: "outline",
|
|
6945
6983
|
fieldAppearance,
|
|
6984
|
+
fieldTheme,
|
|
6946
6985
|
ref: forwardedRef,
|
|
6947
6986
|
...rest
|
|
6948
6987
|
}, /* @__PURE__ */ react.createElement(Icon, { is: icon })))), showTooltip && /* @__PURE__ */ react.createElement(Tooltip.Content, null, disabledTooltipContent));
|
|
@@ -6959,7 +6998,7 @@ var NumberInputContainer = styled("div", {
|
|
|
6959
6998
|
emphasis: { bold: ["gap-0"] }
|
|
6960
6999
|
}
|
|
6961
7000
|
});
|
|
6962
|
-
var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, min = 0, max = Number.MAX_SAFE_INTEGER, step = 1, disabled: isDisabled = false, readonly: isReadOnly = false, size = "md", stepperButtonLabels: stepperButtonLabelsProp, disabledTooltipContent: disabledTooltipContentProp, className, appearance = "standard", emphasis, ...rest }, ref) => {
|
|
7001
|
+
var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, min = 0, max = Number.MAX_SAFE_INTEGER, step = 1, disabled: isDisabled = false, readonly: isReadOnly = false, size = "md", stepperButtonLabels: stepperButtonLabelsProp, disabledTooltipContent: disabledTooltipContentProp, className, appearance = "standard", theme, emphasis, ...rest }, ref) => {
|
|
6963
7002
|
const [internalValue, setInternalValue] = react.useState(value || defaultValue);
|
|
6964
7003
|
react.useEffect(() => {
|
|
6965
7004
|
if (typeof value !== "undefined") setInternalValue(value);
|
|
@@ -7052,6 +7091,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7052
7091
|
onKeyDown,
|
|
7053
7092
|
size,
|
|
7054
7093
|
appearance,
|
|
7094
|
+
theme,
|
|
7055
7095
|
state: externalState || (hasError ? "error" : void 0),
|
|
7056
7096
|
"aria-invalid": externalAriaInvalid || hasError || void 0,
|
|
7057
7097
|
className: (0, clsx.default)("rounded-none", "w-16", "[&_>_input]:text-center", "disabled:opacity-30", "disabled:pointer-events-none", emphasis === "bold" && [
|
|
@@ -7083,6 +7123,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7083
7123
|
className: (0, clsx.default)(emphasis !== "bold" && "border-r-none rounded-r-none"),
|
|
7084
7124
|
size: iconSize,
|
|
7085
7125
|
fieldAppearance: appearance,
|
|
7126
|
+
fieldTheme: theme,
|
|
7086
7127
|
emphasis,
|
|
7087
7128
|
disabled: isAtMin || isDisabled,
|
|
7088
7129
|
showTooltip: isAtMin && !isDisabled,
|
|
@@ -7094,6 +7135,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7094
7135
|
className: (0, clsx.default)(emphasis !== "bold" && "border-l-none rounded-l-none"),
|
|
7095
7136
|
size: iconSize,
|
|
7096
7137
|
fieldAppearance: appearance,
|
|
7138
|
+
fieldTheme: theme,
|
|
7097
7139
|
emphasis,
|
|
7098
7140
|
disabled: isAtMax || isDisabled,
|
|
7099
7141
|
showTooltip: isAtMax && !isDisabled,
|
|
@@ -7104,7 +7146,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7104
7146
|
NumberInput.displayName = "NumberInput";
|
|
7105
7147
|
//#endregion
|
|
7106
7148
|
//#region src/components/number-input-field/NumberInputField.tsx
|
|
7107
|
-
var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt, description, label, name, validation, onValueChange, appearance, ...remainingProps }) => {
|
|
7149
|
+
var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt, description, label, name, validation, onValueChange, appearance, theme, ...remainingProps }) => {
|
|
7108
7150
|
const { control } = (0, react_hook_form.useFormContext)();
|
|
7109
7151
|
const context = useFormCustomContext();
|
|
7110
7152
|
const { field: { ref, onChange, value: innerValue, name: innerName } } = (0, react_hook_form.useController)({
|
|
@@ -7115,6 +7157,7 @@ var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt,
|
|
|
7115
7157
|
});
|
|
7116
7158
|
const { error } = useFieldError(name);
|
|
7117
7159
|
const formAppearance = context?.appearance || appearance;
|
|
7160
|
+
const formTheme = context?.theme ?? theme;
|
|
7118
7161
|
react.useEffect(() => {
|
|
7119
7162
|
if (typeof value !== "undefined") onChange(value);
|
|
7120
7163
|
}, [value]);
|
|
@@ -7143,6 +7186,7 @@ var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt,
|
|
|
7143
7186
|
},
|
|
7144
7187
|
value: innerValue,
|
|
7145
7188
|
appearance: formAppearance,
|
|
7189
|
+
theme: formTheme,
|
|
7146
7190
|
...remainingProps
|
|
7147
7191
|
}));
|
|
7148
7192
|
};
|
|
@@ -7349,12 +7393,13 @@ var RadioCardGroup = ({ className, children, size, isFullWidth, align, ...rest }
|
|
|
7349
7393
|
})));
|
|
7350
7394
|
//#endregion
|
|
7351
7395
|
//#region src/components/search-field/SearchField.tsx
|
|
7352
|
-
var SearchField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
7396
|
+
var SearchField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
7353
7397
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
7354
7398
|
const context = useFormCustomContext();
|
|
7355
7399
|
const { error } = useFieldError(name);
|
|
7356
7400
|
const ref = validation ? register(validation) : register;
|
|
7357
7401
|
const formAppearance = context?.appearance || appearance;
|
|
7402
|
+
const formTheme = context?.theme ?? theme;
|
|
7358
7403
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
7359
7404
|
className,
|
|
7360
7405
|
description,
|
|
@@ -7370,6 +7415,7 @@ var SearchField = ({ className, hideLabel, label, name, validation, prompt, desc
|
|
|
7370
7415
|
name,
|
|
7371
7416
|
ref,
|
|
7372
7417
|
appearance: formAppearance,
|
|
7418
|
+
theme: formTheme,
|
|
7373
7419
|
...error && { state: "error" },
|
|
7374
7420
|
...remainingProps
|
|
7375
7421
|
}));
|
|
@@ -7556,6 +7602,10 @@ var StyledSelect = styled("select", {
|
|
|
7556
7602
|
]
|
|
7557
7603
|
},
|
|
7558
7604
|
state: { error: [] },
|
|
7605
|
+
theme: {
|
|
7606
|
+
white: [],
|
|
7607
|
+
grey: []
|
|
7608
|
+
},
|
|
7559
7609
|
appearance: {
|
|
7560
7610
|
standard: [
|
|
7561
7611
|
"bg-white",
|
|
@@ -7575,15 +7625,28 @@ var StyledSelect = styled("select", {
|
|
|
7575
7625
|
]
|
|
7576
7626
|
}
|
|
7577
7627
|
},
|
|
7578
|
-
compoundVariants: [
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7628
|
+
compoundVariants: [
|
|
7629
|
+
{
|
|
7630
|
+
state: "error",
|
|
7631
|
+
appearance: "standard",
|
|
7632
|
+
class: ["border-danger"]
|
|
7633
|
+
},
|
|
7634
|
+
{
|
|
7635
|
+
state: "error",
|
|
7636
|
+
appearance: "modern",
|
|
7637
|
+
class: ["bg-danger-light", "focus:outline-danger"]
|
|
7638
|
+
},
|
|
7639
|
+
{
|
|
7640
|
+
appearance: "modern",
|
|
7641
|
+
theme: "white",
|
|
7642
|
+
class: ["bg-white"]
|
|
7643
|
+
},
|
|
7644
|
+
{
|
|
7645
|
+
appearance: "modern",
|
|
7646
|
+
theme: "grey",
|
|
7647
|
+
class: ["bg-grey-100"]
|
|
7648
|
+
}
|
|
7649
|
+
]
|
|
7587
7650
|
}, { enabledResponsiveVariants: true });
|
|
7588
7651
|
var Select = react.forwardRef(({ placeholder, children, size = "md", appearance = "standard", ...remainingProps }, ref) => {
|
|
7589
7652
|
const props = {
|
|
@@ -7602,12 +7665,13 @@ var Select = react.forwardRef(({ placeholder, children, size = "md", appearance
|
|
|
7602
7665
|
Select.displayName = "Select";
|
|
7603
7666
|
//#endregion
|
|
7604
7667
|
//#region src/components/select-field/SelectField.tsx
|
|
7605
|
-
var SelectField = ({ className, hideLabel, children, name, label, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
7668
|
+
var SelectField = ({ className, hideLabel, children, name, label, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
7606
7669
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
7607
7670
|
const context = useFormCustomContext();
|
|
7608
7671
|
const { error } = useFieldError(name);
|
|
7609
7672
|
const ref = validation ? register(validation) : register;
|
|
7610
7673
|
const formAppearance = context?.appearance || appearance;
|
|
7674
|
+
const formTheme = context?.theme ?? theme;
|
|
7611
7675
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
7612
7676
|
className,
|
|
7613
7677
|
description,
|
|
@@ -7622,6 +7686,7 @@ var SelectField = ({ className, hideLabel, children, name, label, validation, pr
|
|
|
7622
7686
|
name,
|
|
7623
7687
|
id: name,
|
|
7624
7688
|
appearance: formAppearance,
|
|
7689
|
+
theme: formTheme,
|
|
7625
7690
|
...remainingProps,
|
|
7626
7691
|
ref,
|
|
7627
7692
|
...error && { state: "error" }
|
|
@@ -8656,18 +8721,35 @@ var StyledTextarea = styled("textarea", {
|
|
|
8656
8721
|
"focus-within:z-1"
|
|
8657
8722
|
]
|
|
8658
8723
|
},
|
|
8659
|
-
state: { error: [] }
|
|
8724
|
+
state: { error: [] },
|
|
8725
|
+
theme: {
|
|
8726
|
+
white: [],
|
|
8727
|
+
grey: []
|
|
8728
|
+
}
|
|
8660
8729
|
},
|
|
8661
8730
|
defaultVariants: { appearance: "standard" },
|
|
8662
|
-
compoundVariants: [
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8731
|
+
compoundVariants: [
|
|
8732
|
+
{
|
|
8733
|
+
state: "error",
|
|
8734
|
+
appearance: "standard",
|
|
8735
|
+
class: ["border-danger"]
|
|
8736
|
+
},
|
|
8737
|
+
{
|
|
8738
|
+
state: "error",
|
|
8739
|
+
appearance: "modern",
|
|
8740
|
+
class: ["bg-danger-light", "focus-within:outline-danger"]
|
|
8741
|
+
},
|
|
8742
|
+
{
|
|
8743
|
+
appearance: "modern",
|
|
8744
|
+
theme: "white",
|
|
8745
|
+
class: ["bg-white"]
|
|
8746
|
+
},
|
|
8747
|
+
{
|
|
8748
|
+
appearance: "modern",
|
|
8749
|
+
theme: "grey",
|
|
8750
|
+
class: ["bg-grey-100"]
|
|
8751
|
+
}
|
|
8752
|
+
]
|
|
8671
8753
|
});
|
|
8672
8754
|
var Textarea = react.forwardRef((props, ref) => /* @__PURE__ */ react.createElement(StyledTextarea, {
|
|
8673
8755
|
...props,
|
|
@@ -8676,12 +8758,13 @@ var Textarea = react.forwardRef((props, ref) => /* @__PURE__ */ react.createElem
|
|
|
8676
8758
|
Textarea.displayName = "Textarea";
|
|
8677
8759
|
//#endregion
|
|
8678
8760
|
//#region src/components/textarea-field/TextareaField.tsx
|
|
8679
|
-
var TextareaField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
8761
|
+
var TextareaField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
8680
8762
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
8681
8763
|
const context = useFormCustomContext();
|
|
8682
8764
|
const { error } = useFieldError(name);
|
|
8683
8765
|
const ref = validation ? register(validation) : register;
|
|
8684
8766
|
const formAppearance = context?.appearance || appearance;
|
|
8767
|
+
const formTheme = context?.theme ?? theme;
|
|
8685
8768
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
8686
8769
|
className,
|
|
8687
8770
|
description,
|
|
@@ -8697,6 +8780,7 @@ var TextareaField = ({ className, hideLabel, label, name, validation, prompt, de
|
|
|
8697
8780
|
name,
|
|
8698
8781
|
ref,
|
|
8699
8782
|
appearance: formAppearance,
|
|
8783
|
+
theme: formTheme,
|
|
8700
8784
|
...error && { state: "error" },
|
|
8701
8785
|
...remainingProps
|
|
8702
8786
|
}));
|