@chayns-components/core 5.0.46 → 5.0.48
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/AGENTS.md +60 -0
- package/lib/cjs/components/filter/Filter.js +24 -8
- package/lib/cjs/components/filter/Filter.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FIlterContent.js +3 -2
- package/lib/cjs/components/filter/filter-content/FIlterContent.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.styles.js +9 -3
- package/lib/cjs/components/filter/filter-content/FilterContent.styles.js.map +1 -1
- package/lib/cjs/components/popup/Popup.js +59 -22
- package/lib/cjs/components/popup/Popup.js.map +1 -1
- package/lib/cjs/components/popup/Popup.types.js +6 -0
- package/lib/cjs/components/popup/Popup.types.js.map +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types/filter.js +2 -1
- package/lib/cjs/types/filter.js.map +1 -1
- package/lib/esm/components/filter/Filter.js +24 -8
- package/lib/esm/components/filter/Filter.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FIlterContent.js +4 -3
- package/lib/esm/components/filter/filter-content/FIlterContent.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.styles.js +8 -2
- package/lib/esm/components/filter/filter-content/FilterContent.styles.js.map +1 -1
- package/lib/esm/components/popup/Popup.js +59 -22
- package/lib/esm/components/popup/Popup.js.map +1 -1
- package/lib/esm/components/popup/Popup.types.js +2 -0
- package/lib/esm/components/popup/Popup.types.js.map +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types/filter.js +2 -1
- package/lib/esm/types/filter.js.map +1 -1
- package/lib/types/components/filter/Filter.d.ts +2 -1
- package/lib/types/components/filter/filter-content/FIlterContent.d.ts +2 -1
- package/lib/types/components/filter/filter-content/FilterContent.styles.d.ts +1 -0
- package/lib/types/components/popup/Popup.d.ts +4 -56
- package/lib/types/components/popup/Popup.types.d.ts +151 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/types/filter.d.ts +6 -1
- package/package.json +2 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PopupAlignment } from '../../types/popup';
|
|
3
|
+
export type PopupProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The preferred alignment of the popup relative to its trigger element.
|
|
6
|
+
* @description
|
|
7
|
+
* Use this prop to influence where the popup should appear around its trigger. If no alignment is provided,
|
|
8
|
+
* the component automatically chooses a suitable position based on the available space.
|
|
9
|
+
* @example
|
|
10
|
+
* <Popup alignment={PopupAlignment.BottomRight} content="Details">Open</Popup>
|
|
11
|
+
* @optional
|
|
12
|
+
*/
|
|
13
|
+
alignment?: PopupAlignment;
|
|
14
|
+
/**
|
|
15
|
+
* The trigger element that the popup is attached to.
|
|
16
|
+
* @description
|
|
17
|
+
* This content is rendered in place and acts as the interactive anchor for the popup.
|
|
18
|
+
* Depending on the configured behavior, clicking or hovering this element can show or hide the popup.
|
|
19
|
+
* @example
|
|
20
|
+
* <Popup content="Details"><button type="button">Open</button></Popup>
|
|
21
|
+
* @optional
|
|
22
|
+
*/
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* The DOM element that should receive the popup portal.
|
|
26
|
+
* @description
|
|
27
|
+
* By default, the popup resolves a suitable container automatically. Use this prop when the popup should be rendered
|
|
28
|
+
* into a specific element instead, for example to keep it inside a dialog or another scrollable area.
|
|
29
|
+
* @example
|
|
30
|
+
* <Popup container={document.body} content="Details">Open</Popup>
|
|
31
|
+
* @optional
|
|
32
|
+
*/
|
|
33
|
+
container?: Element;
|
|
34
|
+
/**
|
|
35
|
+
* The content rendered inside the popup.
|
|
36
|
+
* @description
|
|
37
|
+
* This can be any React node, such as text, markup, or a fully custom component tree.
|
|
38
|
+
* @example
|
|
39
|
+
* <Popup content={<div>Additional information</div>}>Open</Popup>
|
|
40
|
+
*/
|
|
41
|
+
content: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Fully controls whether the popup is visible.
|
|
44
|
+
* @description
|
|
45
|
+
* When this prop receives a boolean value, the popup becomes fully controlled from the outside.
|
|
46
|
+
* Internal triggers such as click, hover, outside click, blur handling, or imperative `show` and `hide`
|
|
47
|
+
* calls no longer change the visibility state. The popup is then shown only when `isOpen` is `true`
|
|
48
|
+
* and hidden only when `isOpen` is `false`.
|
|
49
|
+
* @example
|
|
50
|
+
* <Popup isOpen={isPopupOpen} content="Details">Open</Popup>
|
|
51
|
+
* @optional
|
|
52
|
+
*/
|
|
53
|
+
isOpen?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Callback that is called after the popup becomes hidden.
|
|
56
|
+
* @description
|
|
57
|
+
* Use this callback to react to the popup closing, for example to synchronize external UI state.
|
|
58
|
+
* It is called when the effective popup visibility changes from open to closed.
|
|
59
|
+
* @example
|
|
60
|
+
* <Popup onHide={() => console.log('Popup hidden')} content="Details">Open</Popup>
|
|
61
|
+
* @optional
|
|
62
|
+
*/
|
|
63
|
+
onHide?: VoidFunction;
|
|
64
|
+
/**
|
|
65
|
+
* Callback that is called after the popup becomes visible.
|
|
66
|
+
* @description
|
|
67
|
+
* Use this callback to react to the popup opening, for example to start related UI behavior or analytics.
|
|
68
|
+
* It is called when the effective popup visibility changes from closed to open.
|
|
69
|
+
* @example
|
|
70
|
+
* <Popup onShow={() => console.log('Popup shown')} content="Details">Open</Popup>
|
|
71
|
+
* @optional
|
|
72
|
+
*/
|
|
73
|
+
onShow?: VoidFunction;
|
|
74
|
+
/**
|
|
75
|
+
* Hides the popup when the pointer leaves the trigger element.
|
|
76
|
+
* @description
|
|
77
|
+
* This prop is only relevant when `shouldShowOnHover` is enabled. When set to `true`, the popup closes immediately
|
|
78
|
+
* after the pointer leaves the trigger element instead of waiting for the delayed hide behavior.
|
|
79
|
+
* This prop has no effect while `isOpen` is used as a controlled prop.
|
|
80
|
+
* @default false
|
|
81
|
+
* @example
|
|
82
|
+
* <Popup shouldShowOnHover shouldHideOnChildrenLeave content="Details">Open</Popup>
|
|
83
|
+
* @optional
|
|
84
|
+
*/
|
|
85
|
+
shouldHideOnChildrenLeave?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Keeps the popup aligned within the scrolling content container.
|
|
88
|
+
* @description
|
|
89
|
+
* When set to `true`, the popup uses the resolved container for positioning and scroll synchronization.
|
|
90
|
+
* When set to `false`, it is positioned relative to the document body instead.
|
|
91
|
+
* @default true
|
|
92
|
+
* @example
|
|
93
|
+
* <Popup shouldScrollWithContent={false} content="Details">Open</Popup>
|
|
94
|
+
* @optional
|
|
95
|
+
*/
|
|
96
|
+
shouldScrollWithContent?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Opens the popup when the trigger element is hovered instead of clicked.
|
|
99
|
+
* @description
|
|
100
|
+
* By default, the popup opens on click. Set this prop to `true` to switch to hover-based interaction.
|
|
101
|
+
* This prop has no effect while `isOpen` is used as a controlled prop.
|
|
102
|
+
* @default false
|
|
103
|
+
* @example
|
|
104
|
+
* <Popup shouldShowOnHover content="Details">Open</Popup>
|
|
105
|
+
* @optional
|
|
106
|
+
*/
|
|
107
|
+
shouldShowOnHover?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Uses the trigger element width as the popup width reference.
|
|
110
|
+
* @description
|
|
111
|
+
* When enabled, the popup measurement and layout respect the width of the trigger element.
|
|
112
|
+
* Disable this when the popup should size itself more freely based on its content.
|
|
113
|
+
* @default true
|
|
114
|
+
* @example
|
|
115
|
+
* <Popup shouldUseChildrenWidth={false} content="Details">Open</Popup>
|
|
116
|
+
* @optional
|
|
117
|
+
*/
|
|
118
|
+
shouldUseChildrenWidth?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Stretches the trigger element to the full available width.
|
|
121
|
+
* @description
|
|
122
|
+
* This affects the wrapper around the popup trigger and is useful when the trigger should behave like a block-level element.
|
|
123
|
+
* @default false
|
|
124
|
+
* @example
|
|
125
|
+
* <Popup shouldUseFullWidth content="Details">Open</Popup>
|
|
126
|
+
* @optional
|
|
127
|
+
*/
|
|
128
|
+
shouldUseFullWidth?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Requests that the popup should be opened from outside.
|
|
131
|
+
* @description
|
|
132
|
+
* Unlike `isOpen`, this prop does not fully control visibility. It acts as an external open trigger and keeps compatibility
|
|
133
|
+
* with the existing behavior, while other internal interactions may still influence the popup state.
|
|
134
|
+
* Use `isOpen` when you need full external control over showing and hiding the popup.
|
|
135
|
+
* @default false
|
|
136
|
+
* @example
|
|
137
|
+
* <Popup shouldBeOpen={shouldOpenInitially} content="Details">Open</Popup>
|
|
138
|
+
* @optional
|
|
139
|
+
*/
|
|
140
|
+
shouldBeOpen?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Vertical offset between the trigger element and the popup.
|
|
143
|
+
* @description
|
|
144
|
+
* Use this prop to fine-tune the popup position on the Y axis. Positive and negative values can be used depending on the desired spacing.
|
|
145
|
+
* @default 0
|
|
146
|
+
* @example
|
|
147
|
+
* <Popup yOffset={8} content="Details">Open</Popup>
|
|
148
|
+
* @optional
|
|
149
|
+
*/
|
|
150
|
+
yOffset?: number;
|
|
151
|
+
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export { default as Popup } from './components/popup/Popup';
|
|
|
48
48
|
export { default as PopupContent } from './components/popup/popup-content/PopupContent';
|
|
49
49
|
export { default as ProgressBar } from './components/progress-bar/ProgressBar';
|
|
50
50
|
export { PopupAlignment } from './types/popup';
|
|
51
|
+
export type { PopupProps } from './components/popup/Popup.types';
|
|
51
52
|
export { default as RadioButtonGroup, type RadioButtonGroupRef, } from './components/radio-button/radio-button-group/RadioButtonGroup';
|
|
52
53
|
export { default as RadioButton } from './components/radio-button/RadioButton';
|
|
53
54
|
export { default as ScrollView } from './components/scroll-view/ScrollView';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FilterButtonsProps } from '../components/filter-buttons/FilterButtons';
|
|
2
2
|
import { CheckboxProps } from '../components/checkbox/Checkbox';
|
|
3
|
+
import { ComboBoxProps } from '../components/combobox/ComboBox.types';
|
|
3
4
|
export interface SearchConfig {
|
|
4
5
|
onSearchChange: (search: string) => void;
|
|
5
6
|
searchValue: string;
|
|
@@ -15,6 +16,9 @@ export interface SortConfig {
|
|
|
15
16
|
}
|
|
16
17
|
export type CheckboxConfig = CheckboxProps;
|
|
17
18
|
export type FilterButtonConfig = FilterButtonsProps;
|
|
19
|
+
export type ComboboxConfig = ComboBoxProps & {
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
18
22
|
export type FilterRef = {
|
|
19
23
|
hide: VoidFunction;
|
|
20
24
|
show: VoidFunction;
|
|
@@ -24,5 +28,6 @@ export declare enum FilterType {
|
|
|
24
28
|
ONLY_FILTER = 1,
|
|
25
29
|
ONLY_SORT = 2,
|
|
26
30
|
ONLY_CHECKBOX = 3,
|
|
27
|
-
|
|
31
|
+
ONLY_COMBOBOX = 4,
|
|
32
|
+
MULTIPLE = 5
|
|
28
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.48",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "e98343a34fa64dacab5e39cdedfcf5c3d7694b58"
|
|
91
91
|
}
|