@emporix/cockpit-component-library 0.0.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.
@@ -0,0 +1,107 @@
1
+ import { default as React } from 'react';
2
+ export interface DropdownOption {
3
+ label?: string;
4
+ value?: string;
5
+ [key: string]: unknown;
6
+ }
7
+ export interface DropdownChangeEvent {
8
+ value: DropdownOption['value'] | null;
9
+ originalEvent: React.SyntheticEvent;
10
+ }
11
+ export interface DropdownEditEndEvent {
12
+ /** Trimmed value that was in the input when Enter was pressed */
13
+ value: string;
14
+ /** Selected option value if a matching option was found and selected; null otherwise */
15
+ selectedValue: DropdownOption['value'] | null;
16
+ originalEvent: React.KeyboardEvent;
17
+ }
18
+ export interface DropdownProps<T = DropdownOption> {
19
+ /**
20
+ * Selected value (controlled). Must match optionValue of the selected option.
21
+ */
22
+ value?: unknown;
23
+ /**
24
+ * Callback when selection changes
25
+ */
26
+ onChange?: (e: DropdownChangeEvent) => void;
27
+ /**
28
+ * Array of options
29
+ */
30
+ options: T[];
31
+ /**
32
+ * Property name for the option label (default: "label")
33
+ */
34
+ optionLabel?: keyof T | string;
35
+ /**
36
+ * Property name for the option value (default: "value")
37
+ */
38
+ optionValue?: keyof T | string;
39
+ /**
40
+ * Name of the property in the option object that indicates whether the option is disabled.
41
+ * When set (e.g. optionDisabled="disabled"), options with a truthy value for that key
42
+ * are disabled and cannot be selected. Matches PrimeReact Dropdown optionDisabled API.
43
+ * @see https://primereact.org/dropdown/#api.Dropdown.props.optionDisabled
44
+ */
45
+ optionDisabled?: keyof T | string;
46
+ /**
47
+ * Placeholder when no value selected
48
+ */
49
+ placeholder?: string;
50
+ /**
51
+ * Enable filter (search) in the overlay
52
+ */
53
+ filter?: boolean;
54
+ /**
55
+ * When true, the trigger is an editable input: user can type to filter options
56
+ * and select from the list. Matches PrimeReact Dropdown editable behavior.
57
+ * @see https://primereact.org/dropdown/#editable
58
+ */
59
+ editable?: boolean;
60
+ /**
61
+ * Called when the user ends editing by pressing Enter in the editable input.
62
+ * Fires with the trimmed input value and the selected option value (if a match was found).
63
+ */
64
+ onEditEnd?: (e: DropdownEditEndEvent) => void;
65
+ /**
66
+ * Whether the dropdown is disabled
67
+ */
68
+ disabled?: boolean;
69
+ /**
70
+ * Whether the field is required (shows asterisk on label)
71
+ */
72
+ required?: boolean;
73
+ /**
74
+ * Label text displayed above the input
75
+ */
76
+ label?: React.ReactNode;
77
+ /**
78
+ * Input element id for label association
79
+ */
80
+ inputId?: string;
81
+ /**
82
+ * Additional CSS class name for the root
83
+ */
84
+ className?: string;
85
+ /**
86
+ * Additional CSS class name for the overlay panel
87
+ */
88
+ panelClassName?: string;
89
+ /**
90
+ * Template for the selected value displayed in the trigger.
91
+ * Receives the selected option object or null when no value is selected.
92
+ * @see https://primereact.org/dropdown/#template
93
+ */
94
+ valueTemplate?: (option: T | null) => React.ReactNode;
95
+ /**
96
+ * Template for each option in the dropdown list.
97
+ * Receives the option object.
98
+ * @see https://primereact.org/dropdown/#template
99
+ */
100
+ itemTemplate?: (option: T) => React.ReactNode;
101
+ /**
102
+ * Test ID for testing
103
+ */
104
+ 'data-testid'?: string;
105
+ }
106
+ export declare const Dropdown: <T extends Record<string, unknown>>({ value, onChange, onEditEnd, options, optionLabel, optionValue, optionDisabled, placeholder, filter, editable, disabled, required, label, inputId, className, panelClassName, valueTemplate, itemTemplate, "data-testid": testId, }: DropdownProps<T>) => import("react/jsx-runtime").JSX.Element;
107
+ //# sourceMappingURL=Dropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsD,MAAM,OAAO,CAAA;AAI1E,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA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EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,CAAA;IACrD;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;IAC7C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AA4BD,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,sOAoBzD,aAAa,CAAC,CAAC,CAAC,4CAkYlB,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { default as React } from 'react';
2
+ export interface InputTextProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'className'> {
3
+ /**
4
+ * Label text displayed above the input
5
+ */
6
+ label?: React.ReactNode;
7
+ /**
8
+ * When set, an info icon is shown next to the label with this string as tooltip
9
+ */
10
+ tooltip?: string;
11
+ /**
12
+ * Whether the field is required (shows asterisk on label)
13
+ */
14
+ required?: boolean;
15
+ /**
16
+ * Input element id for label association
17
+ */
18
+ inputId?: string;
19
+ /**
20
+ * When true, renders a &lt;textarea&gt; instead of &lt;input&gt;
21
+ */
22
+ textarea?: boolean;
23
+ /**
24
+ * Number of visible rows (textarea only). Defaults to 3 when textarea is true.
25
+ */
26
+ rows?: number;
27
+ /**
28
+ * Additional CSS class name for the root
29
+ */
30
+ className?: string;
31
+ /**
32
+ * Test ID for testing
33
+ */
34
+ 'data-testid'?: string;
35
+ }
36
+ export declare const InputText: ({ label, tooltip, required, inputId: inputIdProp, textarea, rows: rowsProp, className, "data-testid": testId, disabled, ...rest }: InputTextProps) => import("react/jsx-runtime").JSX.Element;
37
+ //# sourceMappingURL=InputText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputText.d.ts","sourceRoot":"","sources":["../../../src/components/input/InputText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAA;AAIpC,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,MAAM,GAAG,WAAW,CACrB;IACC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,SAAS,GAAI,mIAWvB,cAAc,4CA0EhB,CAAA"}
@@ -0,0 +1,63 @@
1
+ import { default as React } from 'react';
2
+ export interface SelectButtonOption {
3
+ label?: string;
4
+ value?: string;
5
+ [key: string]: unknown;
6
+ }
7
+ export interface SelectButtonChangeEvent {
8
+ value: SelectButtonOption['value'] | SelectButtonOption['value'][] | null;
9
+ originalEvent: React.SyntheticEvent;
10
+ }
11
+ export interface SelectButtonProps<T = SelectButtonOption> {
12
+ /**
13
+ * Selected value (controlled). Single value or array when multiple.
14
+ */
15
+ value?: unknown;
16
+ /**
17
+ * Callback when selection changes
18
+ */
19
+ onChange?: (e: SelectButtonChangeEvent) => void;
20
+ /**
21
+ * Array of options
22
+ */
23
+ options: T[];
24
+ /**
25
+ * Property name for the option label (default: "label")
26
+ */
27
+ optionLabel?: keyof T | string;
28
+ /**
29
+ * Property name for the option value (default: "value")
30
+ */
31
+ optionValue?: keyof T | string;
32
+ /**
33
+ * Name of the property that indicates whether an option is disabled.
34
+ * @see https://primereact.org/selectbutton/
35
+ */
36
+ optionDisabled?: keyof T | string;
37
+ /**
38
+ * When true, allows multiple selection (value is an array).
39
+ */
40
+ multiple?: boolean;
41
+ /**
42
+ * Template for each option. Receives the option object.
43
+ */
44
+ itemTemplate?: (option: T) => React.ReactNode;
45
+ /**
46
+ * Whether the component is disabled
47
+ */
48
+ disabled?: boolean;
49
+ /**
50
+ * Invalid state for validation styling
51
+ */
52
+ invalid?: boolean;
53
+ /**
54
+ * Additional CSS class name for the root
55
+ */
56
+ className?: string;
57
+ /**
58
+ * Test ID for testing
59
+ */
60
+ 'data-testid'?: string;
61
+ }
62
+ export declare const SelectButton: <T extends Record<string, unknown>>({ value, onChange, options, optionLabel, optionValue, optionDisabled, multiple, itemTemplate, disabled, invalid, className, "data-testid": testId, }: SelectButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
63
+ //# sourceMappingURL=SelectButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectButton.d.ts","sourceRoot":"","sources":["../../../src/components/selectbutton/SelectButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAA;IACzE,aAAa,EAAE,KAAK,CAAC,cAAc,CAAA;CACpC;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,kBAAkB;IACvD;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC/C;;OAEG;IACH,OAAO,EAAE,CAAC,EAAE,CAAA;IACZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AA4BD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,sJAa7D,iBAAiB,CAAC,CAAC,CAAC,4CAyFtB,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from 'react';
2
+ export interface TabItem {
3
+ /**
4
+ * Unique identifier for the tab
5
+ */
6
+ id: string;
7
+ /**
8
+ * Display label for the tab
9
+ */
10
+ label: string;
11
+ /**
12
+ * Content to display when tab is active
13
+ */
14
+ content: ReactNode;
15
+ }
16
+ export interface TabsProps {
17
+ /**
18
+ * Array of tab items to display
19
+ */
20
+ tabs: TabItem[];
21
+ /**
22
+ * ID of the currently active tab
23
+ */
24
+ activeTabId: string;
25
+ /**
26
+ * Callback function when tab is changed
27
+ */
28
+ onTabChange: (tabId: string) => void;
29
+ /**
30
+ * Additional CSS class name
31
+ */
32
+ className?: string;
33
+ /**
34
+ * Test ID for testing
35
+ */
36
+ 'data-testid'?: string;
37
+ }
38
+ export declare const Tabs: ({ tabs, activeTabId, onTabChange, className, "data-testid": testId, ...props }: TabsProps) => import("react/jsx-runtime").JSX.Element;
39
+ //# sourceMappingURL=Tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,EAAE,SAAS,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,IAAI,EAAE,OAAO,EAAE,CAAA;IACf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,IAAI,GAAI,gFAOlB,SAAS,4CAsCX,CAAA"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Emporix Component Library
3
+ *
4
+ * For components to render with correct layout and styles in your app,
5
+ * import the library styles once (e.g. in your root entry or App):
6
+ *
7
+ * import '@emporix/component-library/styles'
8
+ *
9
+ * Or in CSS: @import '@emporix/component-library/styles';
10
+ */
11
+ export { PrimaryButton } from './components/buttons/PrimaryButton';
12
+ export type { PrimaryButtonProps } from './components/buttons/PrimaryButton';
13
+ export { SecondaryButton } from './components/buttons/SecondaryButton';
14
+ export type { SecondaryButtonProps } from './components/buttons/SecondaryButton';
15
+ export { Tabs } from './components/tabs/Tabs';
16
+ export type { TabsProps, TabItem } from './components/tabs/Tabs';
17
+ export { Dropdown } from './components/dropdown/Dropdown';
18
+ export type { DropdownProps, DropdownOption, DropdownChangeEvent, DropdownEditEndEvent, } from './components/dropdown/Dropdown';
19
+ export { InputText } from './components/input/InputText';
20
+ export type { InputTextProps } from './components/input/InputText';
21
+ export { SelectButton } from './components/selectbutton/SelectButton';
22
+ export type { SelectButtonProps, SelectButtonOption, SelectButtonChangeEvent, } from './components/selectbutton/SelectButton';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAClE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAEhF,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,YAAY,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,wCAAwC,CAAA;AAG/C,OAAO,qBAAqB,CAAA"}