@fluidattacks/design 3.0.1 → 3.1.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.
@@ -1,3 +1,3 @@
1
1
  import { IAccordionContentProps } from "../types";
2
- declare const AccordionContent: ({ isSelectedAndOpen, item, }: Readonly<IAccordionContentProps>) => JSX.Element;
2
+ declare const AccordionContent: ({ item, }: Readonly<IAccordionContentProps>) => JSX.Element;
3
3
  export { AccordionContent };
@@ -14,11 +14,9 @@ interface IAccordionItemProps {
14
14
  /**
15
15
  * Accordion Content props
16
16
  * @interface IAccordionContentProps
17
- * @property {boolean} isSelectedAndOpen If item in accordion is selected and open.
18
17
  * @property {IAccordionItemProps} item Accordion item.
19
18
  */
20
19
  interface IAccordionContentProps {
21
- isSelectedAndOpen: boolean;
22
20
  item: IAccordionItemProps;
23
21
  }
24
22
  /**
@@ -1,7 +1,2 @@
1
- import { TVariant } from "./types";
2
- declare const InputContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
3
- $alert?: boolean;
4
- $disabled: boolean;
5
- $variant: TVariant;
6
- }>> & string;
1
+ declare const InputContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
7
2
  export { InputContainer };
@@ -1,5 +1,4 @@
1
1
  import type { HTMLAttributes } from "react";
2
- type TVariant = "web" | "platform";
3
2
  /**
4
3
  * Checkbox props.
5
4
  * @interface ICheckboxProps
@@ -8,13 +7,11 @@ type TVariant = "web" | "platform";
8
7
  * @property {string} name - Input name.
9
8
  * @property {string} [label] - Checkbox label.
10
9
  * @property {string} [value] - Checkbox value.
11
- * @property {Function} [variant] - Checkbox variant type.
12
10
  */
13
11
  interface ICheckboxProps extends HTMLAttributes<HTMLInputElement> {
14
12
  disabled?: boolean;
15
13
  label?: string;
16
14
  name: string;
17
15
  value?: string;
18
- variant?: TVariant;
19
16
  }
20
- export type { ICheckboxProps, TVariant };
17
+ export type { ICheckboxProps };
@@ -0,0 +1,4 @@
1
+ import { IComboBoxProps } from "./types";
2
+ declare const ComboBox: import("react").ForwardRefExoticComponent<Readonly<IComboBoxProps> & import("react").RefAttributes<HTMLInputElement>>;
3
+ export { ComboBox };
4
+ export type { IComboBoxProps };
@@ -0,0 +1,3 @@
1
+ import { IOptionProps } from "../types";
2
+ declare const Option: <T extends object>({ item, state, }: Readonly<IOptionProps<T>>) => JSX.Element;
3
+ export { Option };
@@ -0,0 +1,3 @@
1
+ declare const StyledDropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
2
+ declare const StyledOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
3
+ export { StyledDropdown, StyledOption };
@@ -0,0 +1,40 @@
1
+ import type { Key } from "react-aria";
2
+ import type { ComboBoxState } from "react-stately";
3
+ import type { IOutlineContainerProps } from "../../types";
4
+ /**
5
+ * Props for the item component.
6
+ * @interface IItem
7
+ * @property { string } name - The name of the item.
8
+ * @property { string } value - The value of the item.
9
+ */
10
+ interface IItem {
11
+ name: string;
12
+ value: string;
13
+ }
14
+ /**
15
+ * Props for the option component.
16
+ * @interface IOptionProps
17
+ * @property { IItem } item - The item to be rendered as an option.
18
+ * @property { ComboBoxState<T> } state - The state of the ComboBox.
19
+ */
20
+ interface IOptionProps<T> {
21
+ item: IItem;
22
+ state: ComboBoxState<T>;
23
+ }
24
+ /**
25
+ * Props for the Select component.
26
+ * @interface IComboBoxProps
27
+ * @property { boolean } [disabled] - Whether the Select is disabled.
28
+ * @property { string } name - The name of the Select.
29
+ * @property { IItem[] } items - The items to be rendered as options.
30
+ * @property { Function } onChange - The callback function to be called when the value of the Select changes.
31
+ * @property { string } value - The value of the Select.
32
+ */
33
+ interface IComboBoxProps extends Partial<Omit<IOutlineContainerProps, "maxLength" | "value">> {
34
+ disabled?: boolean;
35
+ name: string;
36
+ items: IItem[];
37
+ onChange: (key: Key | null) => void;
38
+ value: string;
39
+ }
40
+ export type { IItem, IOptionProps, IComboBoxProps };
@@ -1,3 +1,4 @@
1
+ import { ComboBox } from "./fields/combobox";
1
2
  import { InputDate } from "./fields/date";
2
3
  import { InputDateRange } from "./fields/date-range";
3
4
  import { InputDateTime } from "./fields/date-time";
@@ -10,4 +11,4 @@ import { InputNumberRange } from "./fields/number-range";
10
11
  import { PhoneInput } from "./fields/phone";
11
12
  import { TextArea } from "./fields/text-area";
12
13
  import { OutlineContainer } from "./outline-container";
13
- export { OutlineContainer, PhoneInput, Input, InputDate, InputDateRange, InputDateTime, InputFile, InputNumber, InputTags, InputNumberRange, TextArea, Editable, };
14
+ export { OutlineContainer, PhoneInput, ComboBox, Input, InputDate, InputDateRange, InputDateTime, InputFile, InputNumber, InputTags, InputNumberRange, TextArea, Editable, };
@@ -1,4 +1,4 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import type { IPopoverProps } from "../types";
3
- declare const Popover: ({ children, isFilter, state, ...props }: Readonly<PropsWithChildren<IPopoverProps>>) => JSX.Element;
3
+ declare const Popover: ({ className, children, isFilter, popoverRef, state, triggerRef, ...props }: Readonly<PropsWithChildren<IPopoverProps>>) => JSX.Element;
4
4
  export { Popover };
@@ -21,11 +21,15 @@ interface IActionButtonProps extends Pick<IIconModifiable, "icon">, IBorderModif
21
21
  * Popover component props.
22
22
  * @interface IPopoverProps
23
23
  * @extends AriaPopoverProps
24
+ * @property {string} [className] - The class name of the popover.
24
25
  * @property {boolean} [isFilter] - Indicates if the popover is a filter.
25
26
  * @property {OverlayTriggerState} state - The state of the overlay trigger.
27
+ * @property {RefObject} [popoverRef] - The ref of the popover.
26
28
  */
27
29
  interface IPopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
30
+ className?: string;
28
31
  isFilter?: boolean;
32
+ popoverRef?: React.MutableRefObject<HTMLDivElement | null>;
29
33
  state: OverlayTriggerState;
30
34
  }
31
35
  /**
@@ -36,21 +40,15 @@ interface IPopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
36
40
  * @property {string} [error] - The error message.
37
41
  * @property {React.MutableRefObject<null>} datePickerRef - The ref of the date picker.
38
42
  * @property {boolean} [disabled] - Indicates if the date selector is disabled.
39
- * @property {Function} [handleOnChange] - The function to be called when the date is changed.
40
43
  * @property {React.Ref<HTMLInputElement>} inputRef - The ref of the input.
41
- * @property {boolean} isOpen - Indicates if the date selector is open.
42
44
  * @property {string} name - The name of the date selector.
43
- * @property {string} [variant] - The variant of the date selector.
44
45
  */
45
46
  interface IDateSelectorProps extends Pick<DatePickerAria, "buttonProps" | "fieldProps" | "groupProps">, Pick<AriaDatePickerProps<DateValue>, "granularity"> {
46
47
  error?: string;
47
48
  datePickerRef: React.MutableRefObject<null>;
48
49
  disabled?: boolean;
49
- handleOnChange?: (value: DateValue) => void;
50
50
  inputRef: React.Ref<HTMLInputElement>;
51
- isOpen: boolean;
52
51
  name: string;
53
- variant?: "range";
54
52
  }
55
53
  /**
56
54
  * Date segment component props.
@@ -1,6 +1,4 @@
1
- declare const LabelContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
2
- $disabled: boolean;
3
- }>> & string;
1
+ declare const LabelContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
4
2
  declare const CheckMark: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
5
3
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
6
4
  }>, never>, never>> & string;
package/package.json CHANGED
@@ -12,6 +12,7 @@
12
12
  "react-hook-form": "7.53.2",
13
13
  "react-router-dom": "6.28.0",
14
14
  "react-stately": "3.34.0",
15
+ "react-tooltip": "5.28.0",
15
16
  "styled-components": "6.1.13"
16
17
  },
17
18
  "description": "Fluidattacks core components library",
@@ -53,8 +54,7 @@
53
54
  "tailwindcss": "3.4.16",
54
55
  "typescript": "5.7.2",
55
56
  "typescript-eslint": "8.18.0",
56
- "vite": "6.0.3",
57
- "vite-plugin-css-injected-by-js": "3.5.2"
57
+ "vite": "6.0.3"
58
58
  },
59
59
  "eslintConfig": {
60
60
  "extends": [
@@ -62,8 +62,16 @@
62
62
  ]
63
63
  },
64
64
  "exports": {
65
- ".": "./dist/index.js",
66
- "./button": "./dist/button.js"
65
+ ".": {
66
+ "types": "./dist/types/index.d.ts",
67
+ "import": "./dist/index.mjs",
68
+ "require": "./dist/index.js"
69
+ },
70
+ "./button": {
71
+ "types": "./dist/types/components/button/types.d.ts",
72
+ "import": "./dist/button.mjs",
73
+ "require": "./dist/button.js"
74
+ }
67
75
  },
68
76
  "files": [
69
77
  "README.md",
@@ -76,8 +84,8 @@
76
84
  "fluidattacks"
77
85
  ],
78
86
  "license": "MPL-2.0",
79
- "main": "dist/index.mjs",
80
- "module": "dist/index.js",
87
+ "main": "dist/index.js",
88
+ "module": "dist/index.mjs",
81
89
  "name": "@fluidattacks/design",
82
90
  "peerDependencies": {
83
91
  "@cloudinary/react": "1.13.1",
@@ -90,8 +98,7 @@
90
98
  "motion": "11.15.0",
91
99
  "prismjs": "1.29.0",
92
100
  "react-international-phone": "4.3.0",
93
- "react-joyride": "2.9.3",
94
- "react-tooltip": "5.28.0"
101
+ "react-joyride": "2.9.3"
95
102
  },
96
103
  "publishConfig": {
97
104
  "access": "public"
@@ -108,6 +115,6 @@
108
115
  "storybook": "storybook dev",
109
116
  "test-storybook": "test-storybook"
110
117
  },
111
- "types": "dist/types/index.d.ts",
112
- "version": "3.0.1"
118
+ "typings": "dist/types/index.d.ts",
119
+ "version": "3.1.1"
113
120
  }