@emporix/component-library 1.3.1 → 1.3.3
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/buttons/PrimaryButton.d.ts +29 -0
- package/dist/components/buttons/PrimaryButton.d.ts.map +1 -0
- package/dist/components/buttons/SecondaryButton.d.ts +25 -0
- package/dist/components/buttons/SecondaryButton.d.ts.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +77 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +39 -0
- package/dist/components/tabs/Tabs.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +1076 -0
- package/dist/index.umd.js +30 -0
- package/dist/style.css +1 -0
- package/dist/styles.d.ts +4 -0
- package/package.json +1 -5
- package/dist/assets/index-CGlMSzXO.js +0 -79
- package/dist/assets/index-CcChJOm6.css +0 -1
- package/dist/index.html +0 -14
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PrimaryButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* The content of the button
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the button is disabled
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button is loading
|
|
13
|
+
*/
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Click handler
|
|
17
|
+
*/
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Test ID for testing
|
|
25
|
+
*/
|
|
26
|
+
'data-testid'?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const PrimaryButton: ({ children, disabled, loading, onClick, className, "data-testid": testId, ...props }: PrimaryButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=PrimaryButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,GAAI,sFAQ3B,kBAAkB,4CAsBpB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SecondaryButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* The content of the button
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the button is disabled
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Click handler
|
|
13
|
+
*/
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Additional CSS class name
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Test ID for testing
|
|
21
|
+
*/
|
|
22
|
+
'data-testid'?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const SecondaryButton: ({ children, disabled, onClick, className, "data-testid": testId, ...props }: SecondaryButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=SecondaryButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,eAAe,GAAI,6EAO7B,oBAAoB,4CAqBtB,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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 DropdownProps<T = DropdownOption> {
|
|
12
|
+
/**
|
|
13
|
+
* Selected value (controlled). Must match optionValue of the selected option.
|
|
14
|
+
*/
|
|
15
|
+
value?: unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Callback when selection changes
|
|
18
|
+
*/
|
|
19
|
+
onChange?: (e: DropdownChangeEvent) => 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 in the option object that indicates whether the option is disabled.
|
|
34
|
+
* When set (e.g. optionDisabled="disabled"), options with a truthy value for that key
|
|
35
|
+
* are disabled and cannot be selected. Matches PrimeReact Dropdown optionDisabled API.
|
|
36
|
+
* @see https://primereact.org/dropdown/#api.Dropdown.props.optionDisabled
|
|
37
|
+
*/
|
|
38
|
+
optionDisabled?: keyof T | string;
|
|
39
|
+
/**
|
|
40
|
+
* Placeholder when no value selected
|
|
41
|
+
*/
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Enable filter (search) in the overlay
|
|
45
|
+
*/
|
|
46
|
+
filter?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the dropdown is disabled
|
|
49
|
+
*/
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the field is required (shows asterisk on label)
|
|
53
|
+
*/
|
|
54
|
+
required?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Label text displayed above the input
|
|
57
|
+
*/
|
|
58
|
+
label?: React.ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Input element id for label association
|
|
61
|
+
*/
|
|
62
|
+
inputId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Additional CSS class name for the root
|
|
65
|
+
*/
|
|
66
|
+
className?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Additional CSS class name for the overlay panel
|
|
69
|
+
*/
|
|
70
|
+
panelClassName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Test ID for testing
|
|
73
|
+
*/
|
|
74
|
+
'data-testid'?: string;
|
|
75
|
+
}
|
|
76
|
+
export declare const Dropdown: <T extends Record<string, unknown>>({ value, onChange, options, optionLabel, optionValue, optionDisabled, placeholder, filter, disabled, required, label, inputId, className, panelClassName, "data-testid": testId, }: DropdownProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
//# 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,KAAsC,MAAM,OAAO,CAAA;AAI1D,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IACrC,aAAa,EAAE,KAAK,CAAC,cAAc,CAAA;CACpC;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,cAAc;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAC3C;;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;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AA4BD,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,oLAgBzD,aAAa,CAAC,CAAC,CAAC,4CAyRlB,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"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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, } from './components/dropdown/Dropdown';
|
|
19
|
+
//# 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,GACpB,MAAM,gCAAgC,CAAA;AAGvC,OAAO,qBAAqB,CAAA"}
|