@atom-learning/components 6.11.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/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
- state: { error: ["border", "border-danger"] }
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