@db-ux/react-core-components 3.1.16 → 3.1.18
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/README.md +11 -0
- package/agent/Accordion.md +47 -0
- package/agent/AccordionItem.md +36 -0
- package/agent/Badge.md +43 -0
- package/agent/Brand.md +24 -0
- package/agent/Button.md +60 -0
- package/agent/Card.md +34 -0
- package/agent/Checkbox.md +41 -0
- package/agent/CustomSelect.md +81 -0
- package/agent/Divider.md +32 -0
- package/agent/Drawer.md +87 -0
- package/agent/Header.md +45 -0
- package/agent/Icon.md +31 -0
- package/agent/Infotext.md +36 -0
- package/agent/Input.md +50 -0
- package/agent/Link.md +63 -0
- package/agent/Navigation.md +31 -0
- package/agent/NavigationItem.md +34 -0
- package/agent/Notification.md +45 -0
- package/agent/Page.md +36 -0
- package/agent/Popover.md +55 -0
- package/agent/Radio.md +34 -0
- package/agent/Section.md +32 -0
- package/agent/Select.md +90 -0
- package/agent/Stack.md +46 -0
- package/agent/Switch.md +41 -0
- package/agent/TabItem.md +34 -0
- package/agent/Tabs.md +75 -0
- package/agent/Tag.md +56 -0
- package/agent/Textarea.md +45 -0
- package/agent/Tooltip.md +47 -0
- package/agent/_instructions.md +31 -0
- package/dist/components/tabs/model.d.ts +1 -0
- package/dist/components/tabs/tabs.js +15 -0
- package/package.json +5 -3
package/agent/Tag.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Tag Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBButton } from "@db-ux/react-react-core-components";
|
|
8
|
+
import { DBCheckbox } from "@db-ux/react-react-core-components";
|
|
9
|
+
import { DBLink } from "@db-ux/react-react-core-components";
|
|
10
|
+
import { DBRadio } from "@db-ux/react-react-core-components";
|
|
11
|
+
import { DBTag } from "@db-ux/react-react-core-components";
|
|
12
|
+
|
|
13
|
+
function Tag(props: any) {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<h1>DBTag Documentation Examples</h1>
|
|
17
|
+
<h2>1. Default Tags</h2>
|
|
18
|
+
<DBTag>
|
|
19
|
+
<DBButton>Tag as Button</DBButton>
|
|
20
|
+
</DBTag>
|
|
21
|
+
<DBTag>
|
|
22
|
+
<DBLink>Tag as Link</DBLink>
|
|
23
|
+
</DBTag>
|
|
24
|
+
<DBTag>
|
|
25
|
+
<DBCheckbox>Tag as Checkbox</DBCheckbox>
|
|
26
|
+
</DBTag>
|
|
27
|
+
<DBTag>
|
|
28
|
+
<DBRadio>Tag as Radio</DBRadio>
|
|
29
|
+
</DBTag>
|
|
30
|
+
<DBTag>Static Tag</DBTag>
|
|
31
|
+
<h2>2. Overflow Example</h2>
|
|
32
|
+
<DBTag overflow>
|
|
33
|
+
<span>Static Tag with overflow</span>
|
|
34
|
+
</DBTag>
|
|
35
|
+
<h2>3. Removable Tag</h2>
|
|
36
|
+
<DBTag
|
|
37
|
+
behavior="removable"
|
|
38
|
+
onRemove={(event) => console.log("Tag removed")}
|
|
39
|
+
>
|
|
40
|
+
Removable Tag
|
|
41
|
+
</DBTag>
|
|
42
|
+
<h2>4. Semantic Variants</h2>
|
|
43
|
+
<DBTag semantic="adaptive">Adaptive Tag</DBTag>
|
|
44
|
+
<DBTag semantic="neutral">Neutral Tag</DBTag>
|
|
45
|
+
<DBTag semantic="critical">Critical Tag</DBTag>
|
|
46
|
+
<DBTag semantic="informational">Informational Tag</DBTag>
|
|
47
|
+
<DBTag semantic="warning">Warning Tag</DBTag>
|
|
48
|
+
<DBTag semantic="successful">Successful Tag</DBTag>
|
|
49
|
+
<h2>5. Icon Support</h2>
|
|
50
|
+
<DBTag icon="user">Tag with Icon</DBTag>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default Tag;
|
|
56
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Textarea Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBTextarea } from "@db-ux/react-react-core-components";
|
|
8
|
+
|
|
9
|
+
function Textarea(props: any) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<h1>DBTextarea Documentation Examples</h1>
|
|
13
|
+
<h2>1. Default Textarea</h2>
|
|
14
|
+
<DBTextarea label="Default Textarea" />
|
|
15
|
+
<h2>2. Resizable Variants</h2>
|
|
16
|
+
<DBTextarea resize="none" label="No Resize" />
|
|
17
|
+
<DBTextarea resize="both" label="Resize Both" />
|
|
18
|
+
<DBTextarea resize="horizontal" label="Resize Horizontal" />
|
|
19
|
+
<DBTextarea resize="vertical" label="Resize Vertical" />
|
|
20
|
+
<h2>3. Rows and Columns</h2>
|
|
21
|
+
<DBTextarea label="Custom Rows and Columns" rows={5} cols={30} />
|
|
22
|
+
<h2>4. Wrap Variants</h2>
|
|
23
|
+
<DBTextarea wrap="hard" label="Hard Wrap" />
|
|
24
|
+
<DBTextarea wrap="soft" label="Soft Wrap" />
|
|
25
|
+
<DBTextarea wrap="off" label="No Wrap" />
|
|
26
|
+
<h2>5. Disabled State</h2>
|
|
27
|
+
<DBTextarea label="Disabled Textarea" disabled />
|
|
28
|
+
<h2>6. Placeholder Examples</h2>
|
|
29
|
+
<DBTextarea placeholder="Enter text here" label="With Placeholder" />
|
|
30
|
+
<h2>7. Message Property Example</h2>
|
|
31
|
+
<DBTextarea
|
|
32
|
+
label="Textarea with Message"
|
|
33
|
+
message="This is a helper message."
|
|
34
|
+
/>
|
|
35
|
+
<h2>8. Input Event Example</h2>
|
|
36
|
+
<DBTextarea
|
|
37
|
+
label="Input Event"
|
|
38
|
+
onInput={(event) => console.log("Input event:", event.target.value)}
|
|
39
|
+
/>
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default Textarea;
|
|
45
|
+
```
|
package/agent/Tooltip.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Tooltip Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBButton } from "@db-ux/react-react-core-components";
|
|
8
|
+
import { DBTooltip } from "@db-ux/react-react-core-components";
|
|
9
|
+
|
|
10
|
+
function Tooltip(props: any) {
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<h1>DBTooltip Documentation Examples</h1>
|
|
14
|
+
<h2>1. Default Tooltip</h2>
|
|
15
|
+
<DBButton>
|
|
16
|
+
Hover on me to open Tooltip
|
|
17
|
+
<DBTooltip>Tooltip</DBTooltip>
|
|
18
|
+
</DBButton>
|
|
19
|
+
<h2>2. Tooltip Variants</h2>
|
|
20
|
+
<DBButton>
|
|
21
|
+
Description Tooltip
|
|
22
|
+
<DBTooltip variant="description">Description Tooltip Content</DBTooltip>
|
|
23
|
+
</DBButton>
|
|
24
|
+
<DBButton>
|
|
25
|
+
Label Tooltip
|
|
26
|
+
<DBTooltip variant="label">Label Tooltip Content</DBTooltip>
|
|
27
|
+
</DBButton>
|
|
28
|
+
<h2>3. Tooltip with Arrow</h2>
|
|
29
|
+
<DBButton>
|
|
30
|
+
Tooltip with Arrow
|
|
31
|
+
<DBTooltip showArrow>Tooltip Content with Arrow</DBTooltip>
|
|
32
|
+
</DBButton>
|
|
33
|
+
<h2>4. Placement Variants</h2>
|
|
34
|
+
<DBButton>
|
|
35
|
+
Top Placement
|
|
36
|
+
<DBTooltip placement="top">Tooltip Content at Top</DBTooltip>
|
|
37
|
+
</DBButton>
|
|
38
|
+
<DBButton>
|
|
39
|
+
Bottom Placement
|
|
40
|
+
<DBTooltip placement="bottom">Tooltip Content at Bottom</DBTooltip>
|
|
41
|
+
</DBButton>
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default Tooltip;
|
|
47
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
- Use "@db-ux/react-core-components" as import for components:
|
|
2
|
+
- use for `DBDrawer` or `Drawer` the file __agent-path__/agent/Drawer.md
|
|
3
|
+
- use for `DBTooltip` or `Tooltip` the file __agent-path__/agent/Tooltip.md
|
|
4
|
+
- use for `DBTextarea` or `Textarea` the file __agent-path__/agent/Textarea.md
|
|
5
|
+
- use for `DBTag` or `Tag` the file __agent-path__/agent/Tag.md
|
|
6
|
+
- use for `DBTabs` or `Tabs` the file __agent-path__/agent/Tabs.md
|
|
7
|
+
- use for `DBTabItem` or `TabItem` the file __agent-path__/agent/TabItem.md
|
|
8
|
+
- use for `DBSwitch` or `Switch` the file __agent-path__/agent/Switch.md
|
|
9
|
+
- use for `DBStack` or `Stack` the file __agent-path__/agent/Stack.md
|
|
10
|
+
- use for `DBSelect` or `Select` the file __agent-path__/agent/Select.md
|
|
11
|
+
- use for `DBSection` or `Section` the file __agent-path__/agent/Section.md
|
|
12
|
+
- use for `DBRadio` or `Radio` the file __agent-path__/agent/Radio.md
|
|
13
|
+
- use for `DBPopover` or `Popover` the file __agent-path__/agent/Popover.md
|
|
14
|
+
- use for `DBPage` or `Page` the file __agent-path__/agent/Page.md
|
|
15
|
+
- use for `DBNotification` or `Notification` the file __agent-path__/agent/Notification.md
|
|
16
|
+
- use for `DBNavigationItem` or `NavigationItem` the file __agent-path__/agent/NavigationItem.md
|
|
17
|
+
- use for `DBNavigation` or `Navigation` the file __agent-path__/agent/Navigation.md
|
|
18
|
+
- use for `DBLink` or `Link` the file __agent-path__/agent/Link.md
|
|
19
|
+
- use for `DBInput` or `Input` the file __agent-path__/agent/Input.md
|
|
20
|
+
- use for `DBInfotext` or `Infotext` the file __agent-path__/agent/Infotext.md
|
|
21
|
+
- use for `DBIcon` or `Icon` the file __agent-path__/agent/Icon.md
|
|
22
|
+
- use for `DBHeader` or `Header` the file __agent-path__/agent/Header.md
|
|
23
|
+
- use for `DBDivider` or `Divider` the file __agent-path__/agent/Divider.md
|
|
24
|
+
- use for `DBCustomSelect` or `CustomSelect` the file __agent-path__/agent/CustomSelect.md
|
|
25
|
+
- use for `DBCheckbox` or `Checkbox` the file __agent-path__/agent/Checkbox.md
|
|
26
|
+
- use for `DBCard` or `Card` the file __agent-path__/agent/Card.md
|
|
27
|
+
- use for `DBButton` or `Button` the file __agent-path__/agent/Button.md
|
|
28
|
+
- use for `DBBrand` or `Brand` the file __agent-path__/agent/Brand.md
|
|
29
|
+
- use for `DBBadge` or `Badge` the file __agent-path__/agent/Badge.md
|
|
30
|
+
- use for `DBAccordionItem` or `AccordionItem` the file __agent-path__/agent/AccordionItem.md
|
|
31
|
+
- use for `DBAccordion` or `Accordion` the file __agent-path__/agent/Accordion.md
|
|
@@ -62,5 +62,6 @@ export type DBTabsDefaultState = {
|
|
|
62
62
|
initTabList: () => void;
|
|
63
63
|
initTabs: (init?: boolean) => void;
|
|
64
64
|
handleChange: (event: InputEvent<HTMLElement>) => void;
|
|
65
|
+
_resizeObserver?: ResizeObserver;
|
|
65
66
|
};
|
|
66
67
|
export type DBTabsState = DBTabsDefaultState & GlobalState & InitializedState;
|
|
@@ -16,6 +16,7 @@ function DBTabsFn(props, component) {
|
|
|
16
16
|
const [showScrollLeft, setShowScrollLeft] = useState(() => false);
|
|
17
17
|
const [showScrollRight, setShowScrollRight] = useState(() => false);
|
|
18
18
|
const [scrollContainer, setScrollContainer] = useState(() => null);
|
|
19
|
+
const [_resizeObserver, set_resizeObserver] = useState(() => undefined);
|
|
19
20
|
function convertTabs() {
|
|
20
21
|
try {
|
|
21
22
|
if (typeof props.tabs === "string") {
|
|
@@ -57,6 +58,14 @@ function DBTabsFn(props, component) {
|
|
|
57
58
|
container.addEventListener("scroll", () => {
|
|
58
59
|
evaluateScrollButtons(container);
|
|
59
60
|
});
|
|
61
|
+
// Use ResizeObserver to re-evaluate scroll buttons because it provides more accurate, container-specific resize detection than global window resize events.
|
|
62
|
+
if (!_resizeObserver) {
|
|
63
|
+
const observer = new ResizeObserver(() => {
|
|
64
|
+
evaluateScrollButtons(container);
|
|
65
|
+
});
|
|
66
|
+
observer.observe(container);
|
|
67
|
+
set_resizeObserver(observer);
|
|
68
|
+
}
|
|
60
69
|
}
|
|
61
70
|
}
|
|
62
71
|
}
|
|
@@ -153,6 +162,12 @@ function DBTabsFn(props, component) {
|
|
|
153
162
|
setInitialized(false);
|
|
154
163
|
}
|
|
155
164
|
}, [_ref.current, initialized]);
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
return () => {
|
|
167
|
+
_resizeObserver === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.disconnect();
|
|
168
|
+
set_resizeObserver(undefined);
|
|
169
|
+
};
|
|
170
|
+
}, []);
|
|
156
171
|
return (React.createElement("div", Object.assign({ ref: _ref }, filterPassingProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font", "onTabSelect", "onIndexChange"]), { id: _id }, getRootProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { className: cls("db-tabs", props.className), "data-orientation": props.orientation, "data-scroll-behavior": props.behavior, "data-alignment": (_a = props.alignment) !== null && _a !== void 0 ? _a : "start", "data-width": (_b = props.width) !== null && _b !== void 0 ? _b : "auto", onInput: (event) => handleChange(event), onChange: (event) => handleChange(event) }),
|
|
157
172
|
showScrollLeft ? (React.createElement(DBButton, { className: "tabs-scroll-left", variant: "ghost", icon: "chevron_left", type: "button", noText: true, onClick: (event) => scroll(true) }, "Scroll left")) : null,
|
|
158
173
|
props.tabs ? (React.createElement(React.Fragment, null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@db-ux/react-core-components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.18",
|
|
4
4
|
"description": "React components for @db-ux/core-components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist/",
|
|
15
|
+
"agent",
|
|
15
16
|
"CHANGELOG.md"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build": "npm-run-all tsc",
|
|
19
20
|
"mv:dist": "cpr dist ../../build-outputs/react/dist --overwrite",
|
|
21
|
+
"mv:agent": "cpr agent ../../build-outputs/react/agent --overwrite",
|
|
20
22
|
"mv:package.json": "cpr package.json ../../build-outputs/react/package.json --overwrite",
|
|
21
23
|
"mv:readme": "cpr README.md ../../build-outputs/react/README.md --overwrite",
|
|
22
24
|
"open:report": "npx playwright show-report",
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
},
|
|
40
42
|
"sideEffects": false,
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@db-ux/core-components": "3.1.
|
|
43
|
-
"@db-ux/core-foundations": "3.1.
|
|
44
|
+
"@db-ux/core-components": "3.1.18",
|
|
45
|
+
"@db-ux/core-foundations": "3.1.18"
|
|
44
46
|
}
|
|
45
47
|
}
|