@app-studio/web 0.9.50 → 0.9.51

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.
@@ -9,3 +9,4 @@ export * from './TextArea/TextArea';
9
9
  export * from './TextField/TextField';
10
10
  export * from './Password/Password';
11
11
  export * from './ComboBox/ComboBox';
12
+ export * from './Selector/Selector';
@@ -0,0 +1,68 @@
1
+ import { Elevation } from '../../../../utils/elevation';
2
+ import { InputProps, Shadow, ViewProps } from 'app-studio';
3
+ import { SelectorStyles, Shape, Size, Variant, Option } from './Selector.type';
4
+ export interface SelectorProps extends Omit<InputProps, 'size'> {
5
+ id?: string;
6
+ error?: boolean;
7
+ name?: string;
8
+ label?: string;
9
+ helperText?: string;
10
+ placeholder?: string;
11
+ options: Option[];
12
+ isMulti?: boolean;
13
+ isReadOnly?: boolean;
14
+ isDisabled?: boolean;
15
+ onChange?: (value: any) => void;
16
+ shape?: Shape;
17
+ variant?: Variant;
18
+ views?: SelectorStyles;
19
+ size?: Size;
20
+ shadow?: Shadow | Elevation | ViewProps;
21
+ isScrollable?: boolean;
22
+ }
23
+ export interface SelectorViewProps extends SelectorProps {
24
+ value: string | Array<string>;
25
+ setValue: Function;
26
+ hide: boolean;
27
+ setHide: Function;
28
+ isHovered: boolean;
29
+ setIsHovered: Function;
30
+ isFocused: boolean;
31
+ setIsFocused: Function;
32
+ }
33
+ export interface SelectorBoxProps {
34
+ options: Option[];
35
+ value?: string | Array<string>;
36
+ isDisabled?: boolean;
37
+ placeholder?: string;
38
+ removeOption?: Function;
39
+ views?: SelectorStyles;
40
+ size?: Size;
41
+ }
42
+ export interface MultiSelectorProps extends Omit<InputProps, 'size'> {
43
+ option: string;
44
+ removeOption: Function;
45
+ size?: Size;
46
+ }
47
+ export interface ItemProps extends Omit<InputProps, 'size'> {
48
+ callback?: Function;
49
+ option: Option;
50
+ size?: Size;
51
+ style?: SelectorStyles;
52
+ }
53
+ export interface HiddenSelectorProps extends Omit<InputProps, 'size'> {
54
+ id?: string;
55
+ name?: string;
56
+ value: string | Array<string>;
57
+ isMulti?: boolean;
58
+ isReadOnly?: boolean;
59
+ isDisabled?: boolean;
60
+ onChange?: (value: any) => void;
61
+ options: Option[];
62
+ }
63
+ export interface DropDownProps extends Omit<InputProps, 'size'> {
64
+ size?: Size;
65
+ callback?: Function;
66
+ options: Option[];
67
+ views?: SelectorStyles;
68
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { SelectorProps } from './Selector.props';
3
+ export declare const useSelectorState: ({ placeholder, isMulti, options, id, }: SelectorProps) => {
4
+ id: string;
5
+ value: string | string[];
6
+ setValue: React.Dispatch<React.SetStateAction<string | string[]>>;
7
+ hide: boolean;
8
+ setHide: React.Dispatch<React.SetStateAction<boolean>>;
9
+ isHovered: boolean;
10
+ setIsHovered: React.Dispatch<React.SetStateAction<boolean>>;
11
+ isFocused: boolean;
12
+ setIsFocused: React.Dispatch<React.SetStateAction<boolean>>;
13
+ highlightedIndex: number;
14
+ setHighlightedIndex: React.Dispatch<React.SetStateAction<number>>;
15
+ };
16
+ export declare const useItemState: () => {
17
+ isHovered: boolean;
18
+ setIsHovered: React.Dispatch<React.SetStateAction<boolean>>;
19
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Selector Styles
3
+ *
4
+ * Defines the styles for the Selector component following the design guidelines:
5
+ * - Typography: Inter/Geist font, specific sizes/weights
6
+ * - Spacing: 4px grid system
7
+ * - Colors: Neutral palette with semantic colors
8
+ * - Rounded corners: Consistent border radius
9
+ * - Transitions: Subtle animations
10
+ */
11
+ import { ViewProps } from 'app-studio';
12
+ import { Size } from './Selector.type';
13
+ /**
14
+ * Size configurations for the Selector component
15
+ * Following the 4px grid system
16
+ */
17
+ export declare const Sizes: Record<Size, ViewProps>;
18
+ /**
19
+ * Icon sizes for the Selector component
20
+ * Proportional to the component size
21
+ */
22
+ export declare const IconSizes: Record<Size, number>;
23
+ /**
24
+ * Dropdown styles for the Selector component
25
+ */
26
+ export declare const dropdownStyles: ViewProps;
27
+ /**
28
+ * Option item styles for the Selector component
29
+ */
30
+ export declare const optionStyles: ViewProps;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { SelectorViewProps } from './Selector.props';
3
+ /**
4
+ * SelectorView Component
5
+ *
6
+ * Renders a segmented control style selector.
7
+ */
8
+ declare const SelectorView: React.FC<SelectorViewProps>;
9
+ export default SelectorView;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { SelectorProps } from './Selector/Selector.props';
3
+ export declare const Selector: React.FC<SelectorProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { SelectorProps } from '../Form/Selector/Selector/Selector.props';
3
+ /**
4
+ * Selector provides a dropdown list of options for the user to choose from.
5
+ */
6
+ export declare const FormikSelector: React.FC<SelectorProps>;
@@ -14,4 +14,5 @@ export { FormikComboBox } from './Formik.ComboBox';
14
14
  export { FormikSlider } from './Formik.Slider';
15
15
  export { FormikOTPInput } from './Formik.OTPInput';
16
16
  export { FormikUploader } from './Formik.Uploader';
17
+ export { FormikSelector } from './Formik.Selector';
17
18
  export { AttachmentPreview } from './AttachmentPreview';
@@ -4,15 +4,16 @@
4
4
  * This utility provides consistent typography settings across the application.
5
5
  * It defines font sizes, line heights, and font weights according to the design guidelines.
6
6
  */
7
- import { TextSize, TextWeights } from 'app-studio';
7
+ import { TextWeights } from '../components/Form/Label/Label/Label.type';
8
+ import { Size } from '../components/Input/Input.type';
8
9
  /**
9
10
  * Font sizes following the harmonized typography guidelines
10
11
  */
11
- export declare const FontSizes: Record<TextSize, string | number>;
12
+ export declare const FontSizes: Record<Size, string | number>;
12
13
  /**
13
14
  * Line heights following the harmonized typography guidelines
14
15
  */
15
- export declare const LineHeights: Record<TextSize, string | number>;
16
+ export declare const LineHeights: Record<Size, string | number>;
16
17
  /**
17
18
  * Font weights following typography guidelines
18
19
  */
@@ -23,6 +24,6 @@ export declare const FontWeights: Record<TextWeights, string>;
23
24
  export declare const Typography: {
24
25
  fontSizes: Record<import("../components/Form/DatePicker/DatePicker/DatePicker.type").Size, string | number>;
25
26
  lineHeights: Record<import("../components/Form/DatePicker/DatePicker/DatePicker.type").Size, string | number>;
26
- fontWeights: Record<import("../components/Form/Label/Label/Label.type").TextWeights, string>;
27
+ fontWeights: Record<TextWeights, string>;
27
28
  };
28
29
  export default Typography;