@atom-learning/components 6.10.0 → 6.13.1
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/combobox/Combobox.d.ts +3 -1
- package/dist/components/combobox/ComboboxInput.d.ts +6 -2
- package/dist/components/combobox/ComboboxInput.js +48 -8
- package/dist/components/combobox/ComboboxInput.js.map +1 -1
- package/dist/components/date-field/DateField.d.ts +1 -1
- package/dist/components/date-field/DateField.js +8 -3
- package/dist/components/date-field/DateField.js.map +1 -1
- package/dist/components/date-input/DateInput.d.ts +4 -0
- package/dist/components/date-input/DateInput.js +3 -1
- package/dist/components/date-input/DateInput.js.map +1 -1
- 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/docgen.json +1 -1
- package/dist/index.cjs.js +151 -68
- 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
|
@@ -3096,15 +3096,12 @@ ChipToggleGroup.displayName = "ChipToggleGroupItem";
|
|
|
3096
3096
|
//#region src/components/combobox/ComboboxInput.tsx
|
|
3097
3097
|
var StyledComboboxInput = styled(_reach_combobox.ComboboxInput, {
|
|
3098
3098
|
base: [
|
|
3099
|
-
"bg-white",
|
|
3100
3099
|
"bg-(image:--bg-chevron)",
|
|
3101
3100
|
"bg-position-[right_--spacing(3)_top_50%,0_0]",
|
|
3102
3101
|
"[background-repeat:no-repeat,repeat-x]",
|
|
3103
3102
|
"bg-size-[--spacing(5)_auto,100%]",
|
|
3104
3103
|
"shadow-none",
|
|
3105
3104
|
"appearance-none",
|
|
3106
|
-
"border",
|
|
3107
|
-
"border-grey-700",
|
|
3108
3105
|
"rounded-md",
|
|
3109
3106
|
"box-border",
|
|
3110
3107
|
"text-grey-1000",
|
|
@@ -3120,8 +3117,6 @@ var StyledComboboxInput = styled(_reach_combobox.ComboboxInput, {
|
|
|
3120
3117
|
"w-full",
|
|
3121
3118
|
"placeholder:opacity-100",
|
|
3122
3119
|
"placeholder:text-grey-700",
|
|
3123
|
-
"focus-within:border-primary-800",
|
|
3124
|
-
"focus-within:outline-none",
|
|
3125
3120
|
"disabled:bg-grey-200",
|
|
3126
3121
|
"disabled:cursor-not-allowed",
|
|
3127
3122
|
"disabled:text-grey-800"
|
|
@@ -3144,11 +3139,56 @@ var StyledComboboxInput = styled(_reach_combobox.ComboboxInput, {
|
|
|
3144
3139
|
"leading-loose"
|
|
3145
3140
|
]
|
|
3146
3141
|
},
|
|
3147
|
-
|
|
3148
|
-
|
|
3142
|
+
appearance: {
|
|
3143
|
+
standard: [
|
|
3144
|
+
"bg-white",
|
|
3145
|
+
"border",
|
|
3146
|
+
"border-grey-700",
|
|
3147
|
+
"focus-within:border-primary-800",
|
|
3148
|
+
"focus-within:outline-none"
|
|
3149
|
+
],
|
|
3150
|
+
modern: [
|
|
3151
|
+
"bg-grey-100",
|
|
3152
|
+
"border-none",
|
|
3153
|
+
"focus-within:outline-2",
|
|
3154
|
+
"focus-within:outline-blue-800",
|
|
3155
|
+
"focus-within:outline-offset-1",
|
|
3156
|
+
"focus-within:outline-solid",
|
|
3157
|
+
"focus-within:z-1"
|
|
3158
|
+
]
|
|
3159
|
+
},
|
|
3160
|
+
theme: {
|
|
3161
|
+
white: [],
|
|
3162
|
+
grey: []
|
|
3163
|
+
},
|
|
3164
|
+
state: { error: [] }
|
|
3165
|
+
},
|
|
3166
|
+
compoundVariants: [
|
|
3167
|
+
{
|
|
3168
|
+
state: "error",
|
|
3169
|
+
appearance: "standard",
|
|
3170
|
+
class: ["border", "border-danger"]
|
|
3171
|
+
},
|
|
3172
|
+
{
|
|
3173
|
+
state: "error",
|
|
3174
|
+
appearance: "modern",
|
|
3175
|
+
class: ["bg-danger-light", "focus-within:outline-danger"]
|
|
3176
|
+
},
|
|
3177
|
+
{
|
|
3178
|
+
appearance: "modern",
|
|
3179
|
+
theme: "white",
|
|
3180
|
+
class: ["bg-white"]
|
|
3181
|
+
},
|
|
3182
|
+
{
|
|
3183
|
+
appearance: "modern",
|
|
3184
|
+
theme: "grey",
|
|
3185
|
+
class: ["bg-grey-100"]
|
|
3186
|
+
}
|
|
3187
|
+
]
|
|
3149
3188
|
});
|
|
3150
|
-
var ComboboxInput = react.forwardRef(({ size = "md", ...rest }, ref) => /* @__PURE__ */ react.createElement(StyledComboboxInput, {
|
|
3189
|
+
var ComboboxInput = react.forwardRef(({ size = "md", appearance = "standard", ...rest }, ref) => /* @__PURE__ */ react.createElement(StyledComboboxInput, {
|
|
3151
3190
|
size,
|
|
3191
|
+
appearance,
|
|
3152
3192
|
...rest,
|
|
3153
3193
|
ref
|
|
3154
3194
|
}));
|
|
@@ -5569,7 +5609,7 @@ var DEFAULT_DATE_FORMAT = "DD/MM/YYYY";
|
|
|
5569
5609
|
//#region src/components/date-input/DateInput.tsx
|
|
5570
5610
|
dayjs.default.extend(dayjs_plugin_customParseFormat.default);
|
|
5571
5611
|
var formatDateToString = (date, dateFormat = DEFAULT_DATE_FORMAT) => date ? (0, dayjs.default)(date).format(dateFormat) : "";
|
|
5572
|
-
var DateInput = react.forwardRef(({ initialDate, dateFormat = DEFAULT_DATE_FORMAT, firstDayOfWeek = 1, disabled, monthNames, weekdayNames, size = "md", labels, revalidate, onChange, minDate, maxDate, ...remainingProps }, ref) => {
|
|
5612
|
+
var DateInput = react.forwardRef(({ initialDate, dateFormat = DEFAULT_DATE_FORMAT, firstDayOfWeek = 1, disabled, monthNames, weekdayNames, size = "md", appearance, theme, labels, revalidate, onChange, minDate, maxDate, ...remainingProps }, ref) => {
|
|
5573
5613
|
const [date, setDate] = react.useState(initialDate ? (0, dayjs.default)(initialDate).toDate() : void 0);
|
|
5574
5614
|
const [inputElRef, setInputElRef] = useCallbackRefState();
|
|
5575
5615
|
react.useImperativeHandle(ref, () => inputElRef);
|
|
@@ -5603,6 +5643,8 @@ var DateInput = react.forwardRef(({ initialDate, dateFormat = DEFAULT_DATE_FORMA
|
|
|
5603
5643
|
name: "date",
|
|
5604
5644
|
disabled,
|
|
5605
5645
|
size,
|
|
5646
|
+
appearance,
|
|
5647
|
+
theme,
|
|
5606
5648
|
...remainingProps,
|
|
5607
5649
|
onChange: handleInputChange,
|
|
5608
5650
|
ref: setInputElRef,
|
|
@@ -5653,10 +5695,13 @@ var DateInput = react.forwardRef(({ initialDate, dateFormat = DEFAULT_DATE_FORMA
|
|
|
5653
5695
|
DateInput.displayName = "DateInput";
|
|
5654
5696
|
//#endregion
|
|
5655
5697
|
//#region src/components/date-field/DateField.tsx
|
|
5656
|
-
var DateField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, ...remainingProps }) => {
|
|
5698
|
+
var DateField = ({ className, hideLabel, label, name, validation, prompt, description, appearance, theme, ...remainingProps }) => {
|
|
5657
5699
|
const { register, trigger } = (0, react_hook_form.useFormContext)();
|
|
5700
|
+
const context = useFormCustomContext();
|
|
5658
5701
|
const { error } = useFieldError(name);
|
|
5659
5702
|
const ref = validation ? register(validation) : register;
|
|
5703
|
+
const formAppearance = context?.appearance || appearance;
|
|
5704
|
+
const formTheme = context?.theme ?? theme;
|
|
5660
5705
|
return /* @__PURE__ */ react.createElement(FieldWrapper, {
|
|
5661
5706
|
className,
|
|
5662
5707
|
description,
|
|
@@ -5666,12 +5711,13 @@ var DateField = ({ className, hideLabel, label, name, validation, prompt, descri
|
|
|
5666
5711
|
label,
|
|
5667
5712
|
prompt,
|
|
5668
5713
|
required: Boolean(validation?.required),
|
|
5669
|
-
appearance
|
|
5714
|
+
appearance: formAppearance
|
|
5670
5715
|
}, /* @__PURE__ */ react.createElement(DateInput, {
|
|
5671
5716
|
id: name,
|
|
5672
5717
|
name,
|
|
5673
5718
|
ref,
|
|
5674
|
-
appearance,
|
|
5719
|
+
appearance: formAppearance,
|
|
5720
|
+
theme: formTheme,
|
|
5675
5721
|
...error && { state: "error" },
|
|
5676
5722
|
...remainingProps,
|
|
5677
5723
|
revalidate: trigger
|
|
@@ -5679,6 +5725,16 @@ var DateField = ({ className, hideLabel, label, name, validation, prompt, descri
|
|
|
5679
5725
|
};
|
|
5680
5726
|
DateField.displayName = "DateField";
|
|
5681
5727
|
//#endregion
|
|
5728
|
+
//#region src/components/dialog/DialogActionBar.tsx
|
|
5729
|
+
var DialogActionBar = styled("div", { base: [
|
|
5730
|
+
"border-t",
|
|
5731
|
+
"border-grey-300",
|
|
5732
|
+
"p-4",
|
|
5733
|
+
"flex",
|
|
5734
|
+
"gap-4",
|
|
5735
|
+
"shadow-[0_-6px_6px_-1px_rgba(51,51,51,0.05)]"
|
|
5736
|
+
] });
|
|
5737
|
+
//#endregion
|
|
5682
5738
|
//#region src/components/dialog/DialogBackground.tsx
|
|
5683
5739
|
var DialogBackground = styled("div", { base: ["w-screen", "h-screen"] });
|
|
5684
5740
|
//#endregion
|
|
@@ -5718,62 +5774,69 @@ var StyledDialogContent = styled(_radix_ui_react_dialog.Content, {
|
|
|
5718
5774
|
"motion-safe:data-[state=open]:animate-slide-in-center",
|
|
5719
5775
|
"motion-safe:data-[state=closed]:animate-slide-out-center"
|
|
5720
5776
|
],
|
|
5721
|
-
variants: {
|
|
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
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
+
variants: {
|
|
5778
|
+
size: {
|
|
5779
|
+
xs: [
|
|
5780
|
+
"rounded-md",
|
|
5781
|
+
"size-auto",
|
|
5782
|
+
"max-w-[90vw]",
|
|
5783
|
+
"max-h-[90vh]",
|
|
5784
|
+
"supports-svh:h-auto",
|
|
5785
|
+
"supports-svh:max-h-[90vh]",
|
|
5786
|
+
"w-95"
|
|
5787
|
+
],
|
|
5788
|
+
sm: [
|
|
5789
|
+
"rounded-md",
|
|
5790
|
+
"size-auto",
|
|
5791
|
+
"max-w-[90vw]",
|
|
5792
|
+
"max-h-[90vh]",
|
|
5793
|
+
"supports-svh:h-auto",
|
|
5794
|
+
"supports-svh:max-h-[90vh]",
|
|
5795
|
+
"w-120"
|
|
5796
|
+
],
|
|
5797
|
+
md: [
|
|
5798
|
+
"rounded-md",
|
|
5799
|
+
"size-auto",
|
|
5800
|
+
"max-w-[90vw]",
|
|
5801
|
+
"max-h-[90vh]",
|
|
5802
|
+
"supports-svh:h-auto",
|
|
5803
|
+
"supports-svh:max-h-[90vh]",
|
|
5804
|
+
"w-150"
|
|
5805
|
+
],
|
|
5806
|
+
lg: [
|
|
5807
|
+
"rounded-md",
|
|
5808
|
+
"size-auto",
|
|
5809
|
+
"max-w-[90vw]",
|
|
5810
|
+
"max-h-[90vh]",
|
|
5811
|
+
"supports-svh:h-auto",
|
|
5812
|
+
"supports-svh:max-h-[90vh]",
|
|
5813
|
+
"w-200"
|
|
5814
|
+
],
|
|
5815
|
+
xl: [
|
|
5816
|
+
"rounded-md",
|
|
5817
|
+
"size-auto",
|
|
5818
|
+
"max-w-[90vw]",
|
|
5819
|
+
"max-h-[90vh]",
|
|
5820
|
+
"supports-svh:h-auto",
|
|
5821
|
+
"supports-svh:max-h-[90vh]",
|
|
5822
|
+
"w-275"
|
|
5823
|
+
],
|
|
5824
|
+
fullscreen: [
|
|
5825
|
+
"rounded-none",
|
|
5826
|
+
"w-screen",
|
|
5827
|
+
"h-screen",
|
|
5828
|
+
"max-w-screen",
|
|
5829
|
+
"max-h-screen",
|
|
5830
|
+
"supports-svh:h-svh",
|
|
5831
|
+
"supports-svh:max-h-svh"
|
|
5832
|
+
]
|
|
5833
|
+
},
|
|
5834
|
+
layout: { panel: [
|
|
5835
|
+
"flex",
|
|
5836
|
+
"flex-col",
|
|
5837
|
+
"p-0"
|
|
5838
|
+
] }
|
|
5839
|
+
}
|
|
5777
5840
|
}, { enabledResponsiveVariants: true });
|
|
5778
5841
|
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, {
|
|
5779
5842
|
size,
|
|
@@ -5806,13 +5869,33 @@ var DialogHeading = ({ className, ...rest }) => /* @__PURE__ */ react.createElem
|
|
|
5806
5869
|
className: (0, clsx.default)("border-b", "border-b-grey-200", "pb-8", "pt-0", "px-8", "mb-8", "-mx-8", "box-content", className)
|
|
5807
5870
|
});
|
|
5808
5871
|
//#endregion
|
|
5872
|
+
//#region src/components/dialog/DialogNavigationBar.tsx
|
|
5873
|
+
var DialogNavigationBar = styled("div", { base: [
|
|
5874
|
+
"flex",
|
|
5875
|
+
"justify-between",
|
|
5876
|
+
"items-center",
|
|
5877
|
+
"border-b",
|
|
5878
|
+
"border-grey-300",
|
|
5879
|
+
"p-4"
|
|
5880
|
+
] });
|
|
5881
|
+
//#endregion
|
|
5882
|
+
//#region src/components/dialog/DialogScrollableContent.tsx
|
|
5883
|
+
var DialogScrollableContent = styled("div", { base: [
|
|
5884
|
+
"overflow-scroll",
|
|
5885
|
+
"flex-1",
|
|
5886
|
+
"p-4"
|
|
5887
|
+
] });
|
|
5888
|
+
//#endregion
|
|
5809
5889
|
//#region src/components/dialog/Dialog.tsx
|
|
5810
5890
|
var Dialog = Object.assign(_radix_ui_react_dialog.Root, {
|
|
5891
|
+
ActionBar: DialogActionBar,
|
|
5811
5892
|
Background: DialogBackground,
|
|
5812
5893
|
Close: DialogClose$1,
|
|
5813
5894
|
Content: DialogContent,
|
|
5814
5895
|
Heading: DialogHeading,
|
|
5815
5896
|
Footer: DialogFooter,
|
|
5897
|
+
NavigationBar: DialogNavigationBar,
|
|
5898
|
+
ScrollableContent: DialogScrollableContent,
|
|
5816
5899
|
Description: _radix_ui_react_dialog.Description,
|
|
5817
5900
|
Title: _radix_ui_react_dialog.Title,
|
|
5818
5901
|
Trigger: _radix_ui_react_dialog.Trigger
|