@atom-learning/components 6.9.0 → 6.11.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/dialog/Dialog.d.ts +17 -1
- package/dist/components/dialog/Dialog.js +6 -0
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/DialogActionBar.d.ts +5 -0
- package/dist/components/dialog/DialogActionBar.js +14 -0
- package/dist/components/dialog/DialogActionBar.js.map +1 -0
- package/dist/components/dialog/DialogContent.d.ts +2 -1
- package/dist/components/dialog/DialogContent.js +63 -56
- package/dist/components/dialog/DialogContent.js.map +1 -1
- package/dist/components/dialog/DialogNavigationBar.d.ts +5 -0
- package/dist/components/dialog/DialogNavigationBar.js +14 -0
- package/dist/components/dialog/DialogNavigationBar.js.map +1 -0
- package/dist/components/dialog/DialogScrollableContent.d.ts +5 -0
- package/dist/components/dialog/DialogScrollableContent.js +11 -0
- package/dist/components/dialog/DialogScrollableContent.js.map +1 -0
- 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 +227 -106
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
- package/src/responsive-variant-classes.css +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,
|
|
@@ -5658,6 +5679,16 @@ var DateField = ({ className, hideLabel, label, name, validation, prompt, descri
|
|
|
5658
5679
|
};
|
|
5659
5680
|
DateField.displayName = "DateField";
|
|
5660
5681
|
//#endregion
|
|
5682
|
+
//#region src/components/dialog/DialogActionBar.tsx
|
|
5683
|
+
var DialogActionBar = styled("div", { base: [
|
|
5684
|
+
"border-t",
|
|
5685
|
+
"border-grey-300",
|
|
5686
|
+
"p-4",
|
|
5687
|
+
"flex",
|
|
5688
|
+
"gap-4",
|
|
5689
|
+
"shadow-[0_-6px_6px_-1px_rgba(51,51,51,0.05)]"
|
|
5690
|
+
] });
|
|
5691
|
+
//#endregion
|
|
5661
5692
|
//#region src/components/dialog/DialogBackground.tsx
|
|
5662
5693
|
var DialogBackground = styled("div", { base: ["w-screen", "h-screen"] });
|
|
5663
5694
|
//#endregion
|
|
@@ -5697,62 +5728,69 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
5697
5728
|
"motion-safe:data-[state=open]:animate-slide-in-center",
|
|
5698
5729
|
"motion-safe:data-[state=closed]:animate-slide-out-center"
|
|
5699
5730
|
],
|
|
5700
|
-
variants: {
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5731
|
+
variants: {
|
|
5732
|
+
size: {
|
|
5733
|
+
xs: [
|
|
5734
|
+
"rounded-md",
|
|
5735
|
+
"size-auto",
|
|
5736
|
+
"max-w-[90vw]",
|
|
5737
|
+
"max-h-[90vh]",
|
|
5738
|
+
"supports-svh:h-auto",
|
|
5739
|
+
"supports-svh:max-h-[90vh]",
|
|
5740
|
+
"w-95"
|
|
5741
|
+
],
|
|
5742
|
+
sm: [
|
|
5743
|
+
"rounded-md",
|
|
5744
|
+
"size-auto",
|
|
5745
|
+
"max-w-[90vw]",
|
|
5746
|
+
"max-h-[90vh]",
|
|
5747
|
+
"supports-svh:h-auto",
|
|
5748
|
+
"supports-svh:max-h-[90vh]",
|
|
5749
|
+
"w-120"
|
|
5750
|
+
],
|
|
5751
|
+
md: [
|
|
5752
|
+
"rounded-md",
|
|
5753
|
+
"size-auto",
|
|
5754
|
+
"max-w-[90vw]",
|
|
5755
|
+
"max-h-[90vh]",
|
|
5756
|
+
"supports-svh:h-auto",
|
|
5757
|
+
"supports-svh:max-h-[90vh]",
|
|
5758
|
+
"w-150"
|
|
5759
|
+
],
|
|
5760
|
+
lg: [
|
|
5761
|
+
"rounded-md",
|
|
5762
|
+
"size-auto",
|
|
5763
|
+
"max-w-[90vw]",
|
|
5764
|
+
"max-h-[90vh]",
|
|
5765
|
+
"supports-svh:h-auto",
|
|
5766
|
+
"supports-svh:max-h-[90vh]",
|
|
5767
|
+
"w-200"
|
|
5768
|
+
],
|
|
5769
|
+
xl: [
|
|
5770
|
+
"rounded-md",
|
|
5771
|
+
"size-auto",
|
|
5772
|
+
"max-w-[90vw]",
|
|
5773
|
+
"max-h-[90vh]",
|
|
5774
|
+
"supports-svh:h-auto",
|
|
5775
|
+
"supports-svh:max-h-[90vh]",
|
|
5776
|
+
"w-275"
|
|
5777
|
+
],
|
|
5778
|
+
fullscreen: [
|
|
5779
|
+
"rounded-none",
|
|
5780
|
+
"w-screen",
|
|
5781
|
+
"h-screen",
|
|
5782
|
+
"max-w-screen",
|
|
5783
|
+
"max-h-screen",
|
|
5784
|
+
"supports-svh:h-svh",
|
|
5785
|
+
"supports-svh:max-h-svh"
|
|
5786
|
+
]
|
|
5787
|
+
},
|
|
5788
|
+
layout: { panel: [
|
|
5789
|
+
"flex",
|
|
5790
|
+
"flex-col",
|
|
5791
|
+
"p-0"
|
|
5792
|
+
] }
|
|
5793
|
+
}
|
|
5756
5794
|
}, { enabledResponsiveVariants: true });
|
|
5757
5795
|
var DialogContent = ({ size = "sm", children, closeDialogText = "Close dialog", showCloseButton = true, ...remainingProps }) => /* @__PURE__ */ react.createElement(_radix_ui_react_dialog.Portal, null, /* @__PURE__ */ react.createElement(StyledDialogOverlay, { id: modalOverlayId }, react.Children.map(children, (child) => child?.type === DialogBackground && child), /* @__PURE__ */ react.createElement(StyledDialogContent, {
|
|
5758
5796
|
size,
|
|
@@ -5785,13 +5823,33 @@ var DialogHeading = ({ className, ...rest }) => /* @__PURE__ */ react.createElem
|
|
|
5785
5823
|
className: (0, clsx.default)("border-b", "border-b-grey-200", "pb-8", "pt-0", "px-8", "mb-8", "-mx-8", "box-content", className)
|
|
5786
5824
|
});
|
|
5787
5825
|
//#endregion
|
|
5826
|
+
//#region src/components/dialog/DialogNavigationBar.tsx
|
|
5827
|
+
var DialogNavigationBar = styled("div", { base: [
|
|
5828
|
+
"flex",
|
|
5829
|
+
"justify-between",
|
|
5830
|
+
"items-center",
|
|
5831
|
+
"border-b",
|
|
5832
|
+
"border-grey-300",
|
|
5833
|
+
"p-4"
|
|
5834
|
+
] });
|
|
5835
|
+
//#endregion
|
|
5836
|
+
//#region src/components/dialog/DialogScrollableContent.tsx
|
|
5837
|
+
var DialogScrollableContent = styled("div", { base: [
|
|
5838
|
+
"overflow-scroll",
|
|
5839
|
+
"flex-1",
|
|
5840
|
+
"p-4"
|
|
5841
|
+
] });
|
|
5842
|
+
//#endregion
|
|
5788
5843
|
//#region src/components/dialog/Dialog.tsx
|
|
5789
5844
|
var Dialog = Object.assign(_radix_ui_react_dialog.Root, {
|
|
5845
|
+
ActionBar: DialogActionBar,
|
|
5790
5846
|
Background: DialogBackground,
|
|
5791
5847
|
Close: DialogClose$1,
|
|
5792
5848
|
Content: DialogContent,
|
|
5793
5849
|
Heading: DialogHeading,
|
|
5794
5850
|
Footer: DialogFooter,
|
|
5851
|
+
NavigationBar: DialogNavigationBar,
|
|
5852
|
+
ScrollableContent: DialogScrollableContent,
|
|
5795
5853
|
Description: _radix_ui_react_dialog.Description,
|
|
5796
5854
|
Title: _radix_ui_react_dialog.Title,
|
|
5797
5855
|
Trigger: _radix_ui_react_dialog.Trigger
|
|
@@ -6114,12 +6172,15 @@ Flex.displayName = "Flex";
|
|
|
6114
6172
|
//#endregion
|
|
6115
6173
|
//#region src/components/form/Form.tsx
|
|
6116
6174
|
var Form = (props) => {
|
|
6117
|
-
const { children, defaultValues, validationMode = "onBlur", onSubmit, onError, appearance, ...rest } = props;
|
|
6175
|
+
const { children, defaultValues, validationMode = "onBlur", onSubmit, onError, appearance, theme, ...rest } = props;
|
|
6118
6176
|
const methods = (0, react_hook_form.useForm)({
|
|
6119
6177
|
defaultValues,
|
|
6120
6178
|
mode: validationMode
|
|
6121
6179
|
});
|
|
6122
|
-
return /* @__PURE__ */ react.createElement(react_hook_form.FormProvider, methods, /* @__PURE__ */ react.createElement(FormCustomContext.Provider, { value: {
|
|
6180
|
+
return /* @__PURE__ */ react.createElement(react_hook_form.FormProvider, methods, /* @__PURE__ */ react.createElement(FormCustomContext.Provider, { value: {
|
|
6181
|
+
appearance,
|
|
6182
|
+
theme
|
|
6183
|
+
} }, /* @__PURE__ */ react.createElement("form", {
|
|
6123
6184
|
"aria-label": "form",
|
|
6124
6185
|
onSubmit: methods.handleSubmit(onSubmit, onError),
|
|
6125
6186
|
...rest
|
|
@@ -6157,12 +6218,13 @@ var Grid = ({ className, style, gap = "2", minItemSize, maxItemSize = "1fr", ...
|
|
|
6157
6218
|
Grid.displayName = "Grid";
|
|
6158
6219
|
//#endregion
|
|
6159
6220
|
//#region src/components/input-field/InputField.tsx
|
|
6160
|
-
var InputField = ({ className, label, name, validation, prompt, description, hideLabel, appearance, ...remainingProps }) => {
|
|
6221
|
+
var InputField = ({ className, label, name, validation, prompt, description, hideLabel, appearance, theme, ...remainingProps }) => {
|
|
6161
6222
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
6162
6223
|
const context = useFormCustomContext();
|
|
6163
6224
|
const { error } = useFieldError(name);
|
|
6164
6225
|
const ref = validation ? register(validation) : register;
|
|
6165
6226
|
const formAppearance = context?.appearance || appearance;
|
|
6227
|
+
const formTheme = context?.theme ?? theme;
|
|
6166
6228
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
6167
6229
|
className,
|
|
6168
6230
|
description,
|
|
@@ -6178,6 +6240,7 @@ var InputField = ({ className, label, name, validation, prompt, description, hid
|
|
|
6178
6240
|
name,
|
|
6179
6241
|
ref,
|
|
6180
6242
|
appearance: formAppearance,
|
|
6243
|
+
theme: formTheme,
|
|
6181
6244
|
...error && { state: "error" },
|
|
6182
6245
|
...remainingProps
|
|
6183
6246
|
}));
|
|
@@ -6910,6 +6973,10 @@ var StyledStepperButton = styled(ActionIcon, {
|
|
|
6910
6973
|
"hover:bg-grey-200!"
|
|
6911
6974
|
]
|
|
6912
6975
|
},
|
|
6976
|
+
fieldTheme: {
|
|
6977
|
+
white: [],
|
|
6978
|
+
grey: []
|
|
6979
|
+
},
|
|
6913
6980
|
emphasis: { bold: [
|
|
6914
6981
|
"[&_svg]:text-primary-700",
|
|
6915
6982
|
"hover:bg-primary-100!",
|
|
@@ -6918,18 +6985,26 @@ var StyledStepperButton = styled(ActionIcon, {
|
|
|
6918
6985
|
"active:[&_svg]:text-primary-900!"
|
|
6919
6986
|
] }
|
|
6920
6987
|
},
|
|
6921
|
-
compoundVariants: [
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6988
|
+
compoundVariants: [
|
|
6989
|
+
{
|
|
6990
|
+
fieldAppearance: "modern",
|
|
6991
|
+
fieldTheme: "white",
|
|
6992
|
+
class: ["bg-white"]
|
|
6993
|
+
},
|
|
6994
|
+
{
|
|
6995
|
+
fieldAppearance: "standard",
|
|
6996
|
+
emphasis: "bold",
|
|
6997
|
+
class: ["bg-white", "border-primary-800!"]
|
|
6998
|
+
},
|
|
6999
|
+
{
|
|
7000
|
+
fieldAppearance: "modern",
|
|
7001
|
+
emphasis: "bold",
|
|
7002
|
+
class: ["bg-white!", "hover:bg-primary-100!"]
|
|
7003
|
+
}
|
|
7004
|
+
]
|
|
6930
7005
|
});
|
|
6931
7006
|
var NumberInputStepper = react.forwardRef((props, forwardedRef) => {
|
|
6932
|
-
const { icon, disabledTooltipContent, showTooltip, fieldAppearance = "standard", ...rest } = props;
|
|
7007
|
+
const { icon, disabledTooltipContent, showTooltip, fieldAppearance = "standard", fieldTheme, ...rest } = props;
|
|
6933
7008
|
/**
|
|
6934
7009
|
* Focus has been removed from the button
|
|
6935
7010
|
* as the increment and decrement buttons should be keyboard accessible via arrow keys.
|
|
@@ -6943,6 +7018,7 @@ var NumberInputStepper = react.forwardRef((props, forwardedRef) => {
|
|
|
6943
7018
|
tabIndex: -1,
|
|
6944
7019
|
appearance: "outline",
|
|
6945
7020
|
fieldAppearance,
|
|
7021
|
+
fieldTheme,
|
|
6946
7022
|
ref: forwardedRef,
|
|
6947
7023
|
...rest
|
|
6948
7024
|
}, /* @__PURE__ */ react.createElement(Icon, { is: icon })))), showTooltip && /* @__PURE__ */ react.createElement(Tooltip.Content, null, disabledTooltipContent));
|
|
@@ -6959,7 +7035,7 @@ var NumberInputContainer = styled("div", {
|
|
|
6959
7035
|
emphasis: { bold: ["gap-0"] }
|
|
6960
7036
|
}
|
|
6961
7037
|
});
|
|
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) => {
|
|
7038
|
+
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
7039
|
const [internalValue, setInternalValue] = react.useState(value || defaultValue);
|
|
6964
7040
|
react.useEffect(() => {
|
|
6965
7041
|
if (typeof value !== "undefined") setInternalValue(value);
|
|
@@ -7052,6 +7128,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7052
7128
|
onKeyDown,
|
|
7053
7129
|
size,
|
|
7054
7130
|
appearance,
|
|
7131
|
+
theme,
|
|
7055
7132
|
state: externalState || (hasError ? "error" : void 0),
|
|
7056
7133
|
"aria-invalid": externalAriaInvalid || hasError || void 0,
|
|
7057
7134
|
className: (0, clsx.default)("rounded-none", "w-16", "[&_>_input]:text-center", "disabled:opacity-30", "disabled:pointer-events-none", emphasis === "bold" && [
|
|
@@ -7083,6 +7160,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7083
7160
|
className: (0, clsx.default)(emphasis !== "bold" && "border-r-none rounded-r-none"),
|
|
7084
7161
|
size: iconSize,
|
|
7085
7162
|
fieldAppearance: appearance,
|
|
7163
|
+
fieldTheme: theme,
|
|
7086
7164
|
emphasis,
|
|
7087
7165
|
disabled: isAtMin || isDisabled,
|
|
7088
7166
|
showTooltip: isAtMin && !isDisabled,
|
|
@@ -7094,6 +7172,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7094
7172
|
className: (0, clsx.default)(emphasis !== "bold" && "border-l-none rounded-l-none"),
|
|
7095
7173
|
size: iconSize,
|
|
7096
7174
|
fieldAppearance: appearance,
|
|
7175
|
+
fieldTheme: theme,
|
|
7097
7176
|
emphasis,
|
|
7098
7177
|
disabled: isAtMax || isDisabled,
|
|
7099
7178
|
showTooltip: isAtMax && !isDisabled,
|
|
@@ -7104,7 +7183,7 @@ var NumberInput = react.forwardRef(({ value, defaultValue = 0, onValueChange, mi
|
|
|
7104
7183
|
NumberInput.displayName = "NumberInput";
|
|
7105
7184
|
//#endregion
|
|
7106
7185
|
//#region src/components/number-input-field/NumberInputField.tsx
|
|
7107
|
-
var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt, description, label, name, validation, onValueChange, appearance, ...remainingProps }) => {
|
|
7186
|
+
var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt, description, label, name, validation, onValueChange, appearance, theme, ...remainingProps }) => {
|
|
7108
7187
|
const { control } = (0, react_hook_form.useFormContext)();
|
|
7109
7188
|
const context = useFormCustomContext();
|
|
7110
7189
|
const { field: { ref, onChange, value: innerValue, name: innerName } } = (0, react_hook_form.useController)({
|
|
@@ -7115,6 +7194,7 @@ var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt,
|
|
|
7115
7194
|
});
|
|
7116
7195
|
const { error } = useFieldError(name);
|
|
7117
7196
|
const formAppearance = context?.appearance || appearance;
|
|
7197
|
+
const formTheme = context?.theme ?? theme;
|
|
7118
7198
|
react.useEffect(() => {
|
|
7119
7199
|
if (typeof value !== "undefined") onChange(value);
|
|
7120
7200
|
}, [value]);
|
|
@@ -7143,6 +7223,7 @@ var NumberInputField = ({ className, defaultValue = 0, hideLabel, value, prompt,
|
|
|
7143
7223
|
},
|
|
7144
7224
|
value: innerValue,
|
|
7145
7225
|
appearance: formAppearance,
|
|
7226
|
+
theme: formTheme,
|
|
7146
7227
|
...remainingProps
|
|
7147
7228
|
}));
|
|
7148
7229
|
};
|
|
@@ -7349,12 +7430,13 @@ var RadioCardGroup = ({ className, children, size, isFullWidth, align, ...rest }
|
|
|
7349
7430
|
})));
|
|
7350
7431
|
//#endregion
|
|
7351
7432
|
//#region src/components/search-field/SearchField.tsx
|
|
7352
|
-
var SearchField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
7433
|
+
var SearchField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
7353
7434
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
7354
7435
|
const context = useFormCustomContext();
|
|
7355
7436
|
const { error } = useFieldError(name);
|
|
7356
7437
|
const ref = validation ? register(validation) : register;
|
|
7357
7438
|
const formAppearance = context?.appearance || appearance;
|
|
7439
|
+
const formTheme = context?.theme ?? theme;
|
|
7358
7440
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
7359
7441
|
className,
|
|
7360
7442
|
description,
|
|
@@ -7370,6 +7452,7 @@ var SearchField = ({ className, hideLabel, label, name, validation, prompt, desc
|
|
|
7370
7452
|
name,
|
|
7371
7453
|
ref,
|
|
7372
7454
|
appearance: formAppearance,
|
|
7455
|
+
theme: formTheme,
|
|
7373
7456
|
...error && { state: "error" },
|
|
7374
7457
|
...remainingProps
|
|
7375
7458
|
}));
|
|
@@ -7556,6 +7639,10 @@ var StyledSelect = styled("select", {
|
|
|
7556
7639
|
]
|
|
7557
7640
|
},
|
|
7558
7641
|
state: { error: [] },
|
|
7642
|
+
theme: {
|
|
7643
|
+
white: [],
|
|
7644
|
+
grey: []
|
|
7645
|
+
},
|
|
7559
7646
|
appearance: {
|
|
7560
7647
|
standard: [
|
|
7561
7648
|
"bg-white",
|
|
@@ -7575,15 +7662,28 @@ var StyledSelect = styled("select", {
|
|
|
7575
7662
|
]
|
|
7576
7663
|
}
|
|
7577
7664
|
},
|
|
7578
|
-
compoundVariants: [
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7665
|
+
compoundVariants: [
|
|
7666
|
+
{
|
|
7667
|
+
state: "error",
|
|
7668
|
+
appearance: "standard",
|
|
7669
|
+
class: ["border-danger"]
|
|
7670
|
+
},
|
|
7671
|
+
{
|
|
7672
|
+
state: "error",
|
|
7673
|
+
appearance: "modern",
|
|
7674
|
+
class: ["bg-danger-light", "focus:outline-danger"]
|
|
7675
|
+
},
|
|
7676
|
+
{
|
|
7677
|
+
appearance: "modern",
|
|
7678
|
+
theme: "white",
|
|
7679
|
+
class: ["bg-white"]
|
|
7680
|
+
},
|
|
7681
|
+
{
|
|
7682
|
+
appearance: "modern",
|
|
7683
|
+
theme: "grey",
|
|
7684
|
+
class: ["bg-grey-100"]
|
|
7685
|
+
}
|
|
7686
|
+
]
|
|
7587
7687
|
}, { enabledResponsiveVariants: true });
|
|
7588
7688
|
var Select = react.forwardRef(({ placeholder, children, size = "md", appearance = "standard", ...remainingProps }, ref) => {
|
|
7589
7689
|
const props = {
|
|
@@ -7602,12 +7702,13 @@ var Select = react.forwardRef(({ placeholder, children, size = "md", appearance
|
|
|
7602
7702
|
Select.displayName = "Select";
|
|
7603
7703
|
//#endregion
|
|
7604
7704
|
//#region src/components/select-field/SelectField.tsx
|
|
7605
|
-
var SelectField = ({ className, hideLabel, children, name, label, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
7705
|
+
var SelectField = ({ className, hideLabel, children, name, label, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
7606
7706
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
7607
7707
|
const context = useFormCustomContext();
|
|
7608
7708
|
const { error } = useFieldError(name);
|
|
7609
7709
|
const ref = validation ? register(validation) : register;
|
|
7610
7710
|
const formAppearance = context?.appearance || appearance;
|
|
7711
|
+
const formTheme = context?.theme ?? theme;
|
|
7611
7712
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
7612
7713
|
className,
|
|
7613
7714
|
description,
|
|
@@ -7622,6 +7723,7 @@ var SelectField = ({ className, hideLabel, children, name, label, validation, pr
|
|
|
7622
7723
|
name,
|
|
7623
7724
|
id: name,
|
|
7624
7725
|
appearance: formAppearance,
|
|
7726
|
+
theme: formTheme,
|
|
7625
7727
|
...remainingProps,
|
|
7626
7728
|
ref,
|
|
7627
7729
|
...error && { state: "error" }
|
|
@@ -8656,18 +8758,35 @@ var StyledTextarea = styled("textarea", {
|
|
|
8656
8758
|
"focus-within:z-1"
|
|
8657
8759
|
]
|
|
8658
8760
|
},
|
|
8659
|
-
state: { error: [] }
|
|
8761
|
+
state: { error: [] },
|
|
8762
|
+
theme: {
|
|
8763
|
+
white: [],
|
|
8764
|
+
grey: []
|
|
8765
|
+
}
|
|
8660
8766
|
},
|
|
8661
8767
|
defaultVariants: { appearance: "standard" },
|
|
8662
|
-
compoundVariants: [
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8768
|
+
compoundVariants: [
|
|
8769
|
+
{
|
|
8770
|
+
state: "error",
|
|
8771
|
+
appearance: "standard",
|
|
8772
|
+
class: ["border-danger"]
|
|
8773
|
+
},
|
|
8774
|
+
{
|
|
8775
|
+
state: "error",
|
|
8776
|
+
appearance: "modern",
|
|
8777
|
+
class: ["bg-danger-light", "focus-within:outline-danger"]
|
|
8778
|
+
},
|
|
8779
|
+
{
|
|
8780
|
+
appearance: "modern",
|
|
8781
|
+
theme: "white",
|
|
8782
|
+
class: ["bg-white"]
|
|
8783
|
+
},
|
|
8784
|
+
{
|
|
8785
|
+
appearance: "modern",
|
|
8786
|
+
theme: "grey",
|
|
8787
|
+
class: ["bg-grey-100"]
|
|
8788
|
+
}
|
|
8789
|
+
]
|
|
8671
8790
|
});
|
|
8672
8791
|
var Textarea = react.forwardRef((props, ref) => /* @__PURE__ */ react.createElement(StyledTextarea, {
|
|
8673
8792
|
...props,
|
|
@@ -8676,12 +8795,13 @@ var Textarea = react.forwardRef((props, ref) => /* @__PURE__ */ react.createElem
|
|
|
8676
8795
|
Textarea.displayName = "Textarea";
|
|
8677
8796
|
//#endregion
|
|
8678
8797
|
//#region src/components/textarea-field/TextareaField.tsx
|
|
8679
|
-
var TextareaField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
8798
|
+
var TextareaField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
8680
8799
|
const { register } = (0, react_hook_form.useFormContext)();
|
|
8681
8800
|
const context = useFormCustomContext();
|
|
8682
8801
|
const { error } = useFieldError(name);
|
|
8683
8802
|
const ref = validation ? register(validation) : register;
|
|
8684
8803
|
const formAppearance = context?.appearance || appearance;
|
|
8804
|
+
const formTheme = context?.theme ?? theme;
|
|
8685
8805
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
8686
8806
|
className,
|
|
8687
8807
|
description,
|
|
@@ -8697,6 +8817,7 @@ var TextareaField = ({ className, hideLabel, label, name, validation, prompt, de
|
|
|
8697
8817
|
name,
|
|
8698
8818
|
ref,
|
|
8699
8819
|
appearance: formAppearance,
|
|
8820
|
+
theme: formTheme,
|
|
8700
8821
|
...error && { state: "error" },
|
|
8701
8822
|
...remainingProps
|
|
8702
8823
|
}));
|