@db-ux/react-core-components 4.5.0 → 4.5.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.
- package/CHANGELOG.md +14 -0
- package/agent/.gitkeep +0 -0
- package/dist/components/custom-select/custom-select.js +7 -3
- package/dist/utils/floating-components.js +4 -0
- package/package.json +3 -3
- package/agent/Accordion.md +0 -47
- package/agent/AccordionItem.md +0 -36
- package/agent/Badge.md +0 -43
- package/agent/Brand.md +0 -24
- package/agent/Button.md +0 -60
- package/agent/Card.md +0 -34
- package/agent/Checkbox.md +0 -41
- package/agent/CustomSelect.md +0 -81
- package/agent/Divider.md +0 -32
- package/agent/Drawer.md +0 -87
- package/agent/Header.md +0 -45
- package/agent/Icon.md +0 -31
- package/agent/Infotext.md +0 -36
- package/agent/Input.md +0 -50
- package/agent/Link.md +0 -63
- package/agent/Navigation.md +0 -31
- package/agent/NavigationItem.md +0 -34
- package/agent/Notification.md +0 -45
- package/agent/Page.md +0 -36
- package/agent/Popover.md +0 -55
- package/agent/Radio.md +0 -34
- package/agent/Section.md +0 -32
- package/agent/Select.md +0 -90
- package/agent/Stack.md +0 -46
- package/agent/Switch.md +0 -41
- package/agent/TabItem.md +0 -34
- package/agent/Tabs.md +0 -75
- package/agent/Tag.md +0 -56
- package/agent/Textarea.md +0 -45
- package/agent/Tooltip.md +0 -47
- package/agent/_instructions.md +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @db-ux/react-core-components
|
|
2
2
|
|
|
3
|
+
## 4.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: issue with DBButton `noText` and `width="full"` not having fixed size - [see commit bc81b40](https://github.com/db-ux-design-system/core-web/commit/bc81b402660871d706b1bf8d3fbac6713a7c9670)
|
|
8
|
+
|
|
9
|
+
- fix: issue with hover state when using DBPopover/Tooltip with animation - [see commit bc4801b](https://github.com/db-ux-design-system/core-web/commit/bc4801bf0b32d5dc4fd8e29626a6122e34fb6ada)
|
|
10
|
+
|
|
11
|
+
- fix: Add null guard in `floating-components.ts` to prevent errors when `element` or `parent` is `null` inside tests. - [see commit ac50f97](https://github.com/db-ux-design-system/core-web/commit/ac50f97fa503ef4f62d37f316f3b5da0f6d7742e)
|
|
12
|
+
|
|
13
|
+
- fix: issue with DBCustomSelect inside DBDrawer (or other `<dialog>` based) components, which has a problem with top-layer and focus - [see commit 6547ada](https://github.com/db-ux-design-system/core-web/commit/6547ada44844cbed1b8207db742a5119edb945f6)
|
|
14
|
+
|
|
15
|
+
- fix(`input type="date"`): wrong padding and color for successful and critical state - [see commit 4f3db42](https://github.com/db-ux-design-system/core-web/commit/4f3db4262a652ac8d6353bd1a0a92a4a62b6ff86)
|
|
16
|
+
|
|
3
17
|
## 4.5.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/agent/.gitkeep
ADDED
|
File without changes
|
|
@@ -324,10 +324,14 @@ function DBCustomSelectFn(props, component) {
|
|
|
324
324
|
else if (detailsRef.current.open && event) {
|
|
325
325
|
if (event.relatedTarget) {
|
|
326
326
|
const relatedTarget = event.relatedTarget;
|
|
327
|
-
if
|
|
327
|
+
// We close if the focus is on something like a <button> etc. which is not inside the <details> element
|
|
328
|
+
// Inside a <dialog> there is some focus problem because of the top-layer
|
|
329
|
+
// We do not want to focus <dialog> itself
|
|
330
|
+
if (!detailsRef.current.contains(relatedTarget) &&
|
|
331
|
+
relatedTarget.localName !== "dialog") {
|
|
328
332
|
// We need to use delay here because the combination of `contains`
|
|
329
333
|
// and changing the DOM element causes a race condition inside browser
|
|
330
|
-
delay(() => (detailsRef.current.open = false), 1);
|
|
334
|
+
void delay(() => (detailsRef.current.open = false), 1);
|
|
331
335
|
}
|
|
332
336
|
}
|
|
333
337
|
}
|
|
@@ -694,7 +698,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
694
698
|
(_selectedLabels === null || _selectedLabels === void 0 ? void 0 : _selectedLabels.length) ? (React.createElement("span", { "data-visually-hidden": getBooleanAsString(props.selectedType === "tag"), id: _selectedLabelsId },
|
|
695
699
|
props.selectedPrefix ? (React.createElement("span", { "data-visually-hidden": "true" }, props.selectedPrefix)) : null,
|
|
696
700
|
_selectedLabels)) : null,
|
|
697
|
-
props.selectedType === "tag" ? (React.createElement("div", null, _selectedOptions === null || _selectedOptions === void 0 ? void 0 : _selectedOptions.map((option
|
|
701
|
+
props.selectedType === "tag" ? (React.createElement("div", null, _selectedOptions === null || _selectedOptions === void 0 ? void 0 : _selectedOptions.map((option) => (React.createElement(DBTag, { emphasis: "strong", behavior: "removable", removeButton: getTagRemoveLabel(option), onRemove: (event) => handleTagRemove(option, event), key: getOptionKey(option, "tag-") }, getOptionLabel(option)))))) : null),
|
|
698
702
|
React.createElement(DBCustomSelectDropdown, { width: props.dropdownWidth },
|
|
699
703
|
searchEnabled ? (React.createElement("div", null,
|
|
700
704
|
React.createElement(DBInput, { type: "search", ref: searchInputRef, name: _id, form: _id, showLabel: false, value: _searchValue, label: (_e = props.searchLabel) !== null && _e !== void 0 ? _e : DEFAULT_LABEL, placeholder: (_f = props.searchPlaceholder) !== null && _f !== void 0 ? _f : props.searchLabel, ariaDescribedBy: _hasNoOptions || props.showLoading
|
|
@@ -60,6 +60,8 @@ export const handleDataOutside = (el) => {
|
|
|
60
60
|
return dataOutsidePair;
|
|
61
61
|
};
|
|
62
62
|
export const handleFixedDropdown = (element, parent, placement) => {
|
|
63
|
+
if (!element || !parent)
|
|
64
|
+
return;
|
|
63
65
|
// We skip this if we are in mobile it's already fixed
|
|
64
66
|
if (getComputedStyle(element).zIndex === '9999')
|
|
65
67
|
return;
|
|
@@ -249,6 +251,8 @@ const getAncestorHasCorrectedPlacement = (element) => {
|
|
|
249
251
|
};
|
|
250
252
|
export const handleFixedPopover = (element, parent, placement) => {
|
|
251
253
|
var _a, _b;
|
|
254
|
+
if (!element || !parent)
|
|
255
|
+
return;
|
|
252
256
|
const parentComputedStyles = getComputedStyle(parent);
|
|
253
257
|
const parentHasFloatingPosition = ['absolute', 'fixed'].includes(parentComputedStyles.position);
|
|
254
258
|
const ancestorWithCorrectedPlacement = getAncestorHasCorrectedPlacement(element);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@db-ux/react-core-components",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "React components for @db-ux/core-components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@db-ux/core-components": "4.5.
|
|
45
|
-
"@db-ux/core-foundations": "4.5.
|
|
44
|
+
"@db-ux/core-components": "4.5.1",
|
|
45
|
+
"@db-ux/core-foundations": "4.5.1"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/agent/Accordion.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Accordion Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBAccordion } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Accordion(props: any) {
|
|
10
|
-
function getItems() {
|
|
11
|
-
return [
|
|
12
|
-
{
|
|
13
|
-
text: "Item 1 Content",
|
|
14
|
-
headlinePlain: "Item 1",
|
|
15
|
-
disabled: false,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
text: "Item 2 Content",
|
|
19
|
-
headlinePlain: "Item 2",
|
|
20
|
-
disabled: true,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<>
|
|
27
|
-
<h1>DBAccordion Documentation Examples</h1>
|
|
28
|
-
<h2>1. Default Accordion</h2>
|
|
29
|
-
<DBAccordion>Default Accordion</DBAccordion>
|
|
30
|
-
<h2>2. Behavior Variants</h2>
|
|
31
|
-
<DBAccordion behavior="multiple">Multiple Behavior</DBAccordion>
|
|
32
|
-
<DBAccordion behavior="single">Single Behavior</DBAccordion>
|
|
33
|
-
<h2>3. Initial Open Index</h2>
|
|
34
|
-
<DBAccordion initOpenIndex={[0, 1]}>Initial Open Index</DBAccordion>
|
|
35
|
-
<h2>4. Items</h2>
|
|
36
|
-
<DBAccordion items={getItems()}>Accordion with Items</DBAccordion>
|
|
37
|
-
<h2>5. Name Attribute</h2>
|
|
38
|
-
<DBAccordion name="accordion-name">With Name</DBAccordion>
|
|
39
|
-
<h2>6. Variant Types</h2>
|
|
40
|
-
<DBAccordion variant="divider">Divider Variant</DBAccordion>
|
|
41
|
-
<DBAccordion variant="card">Card Variant</DBAccordion>
|
|
42
|
-
</>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default Accordion;
|
|
47
|
-
```
|
package/agent/AccordionItem.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# AccordionItem Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBAccordionItem } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function AccordionItem(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBAccordionItem Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Accordion Item</h2>
|
|
14
|
-
<DBAccordionItem>Default Accordion Item</DBAccordionItem>
|
|
15
|
-
<h2>2. Initial State</h2>
|
|
16
|
-
<DBAccordionItem defaultOpen>Initially Open</DBAccordionItem>
|
|
17
|
-
<DBAccordionItem defaultOpen={false}>Initially Closed</DBAccordionItem>
|
|
18
|
-
<h2>3. Disabled State</h2>
|
|
19
|
-
<DBAccordionItem disabled>Disabled Accordion Item</DBAccordionItem>
|
|
20
|
-
<h2>4. Headline Variants</h2>
|
|
21
|
-
<DBAccordionItem headline={<strong>Custom Headline</strong>}>
|
|
22
|
-
With Custom Headline
|
|
23
|
-
</DBAccordionItem>
|
|
24
|
-
<DBAccordionItem headlinePlain="Plain Headline">
|
|
25
|
-
With Plain Headline
|
|
26
|
-
</DBAccordionItem>
|
|
27
|
-
<h2>5. Toggle Event</h2>
|
|
28
|
-
<DBAccordionItem onToggle={(open) => console.log("Toggled:", open)}>
|
|
29
|
-
With Toggle Event
|
|
30
|
-
</DBAccordionItem>
|
|
31
|
-
</>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default AccordionItem;
|
|
36
|
-
```
|
package/agent/Badge.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Badge Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBBadge } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Badge(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBBadge Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Badge</h2>
|
|
14
|
-
<DBBadge>Default Badge</DBBadge>
|
|
15
|
-
<h2>2. Semantic Variants</h2>
|
|
16
|
-
<DBBadge semantic="adaptive">Adaptive</DBBadge>
|
|
17
|
-
<DBBadge semantic="neutral">Neutral</DBBadge>
|
|
18
|
-
<DBBadge semantic="critical">Critical</DBBadge>
|
|
19
|
-
<DBBadge semantic="informational">Informational</DBBadge>
|
|
20
|
-
<DBBadge semantic="warning">Warning</DBBadge>
|
|
21
|
-
<DBBadge semantic="successful">Successful</DBBadge>
|
|
22
|
-
<h2>3. Sizes</h2>
|
|
23
|
-
<DBBadge size="small">Small</DBBadge>
|
|
24
|
-
<DBBadge size="medium">Medium</DBBadge>
|
|
25
|
-
<h2>4. Emphasis Variants</h2>
|
|
26
|
-
<DBBadge emphasis="weak">Weak Emphasis</DBBadge>
|
|
27
|
-
<DBBadge emphasis="strong">Strong Emphasis</DBBadge>
|
|
28
|
-
<h2>5. Placement Variants</h2>
|
|
29
|
-
<DBBadge placement="inline">Inline</DBBadge>
|
|
30
|
-
<DBBadge placement="corner-top-left">Corner Top Left</DBBadge>
|
|
31
|
-
<DBBadge placement="corner-top-right">Corner Top Right</DBBadge>
|
|
32
|
-
<DBBadge placement="corner-center-left">Corner Center Left</DBBadge>
|
|
33
|
-
<DBBadge placement="corner-center-right">Corner Center Right</DBBadge>
|
|
34
|
-
<DBBadge placement="corner-bottom-left">Corner Bottom Left</DBBadge>
|
|
35
|
-
<DBBadge placement="corner-bottom-right">Corner Bottom Right</DBBadge>
|
|
36
|
-
<h2>6. Custom Label</h2>
|
|
37
|
-
<DBBadge label="Custom Label">With Custom Label</DBBadge>
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default Badge;
|
|
43
|
-
```
|
package/agent/Brand.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Brand Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBBrand } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Brand(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBBrand Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Brand</h2>
|
|
14
|
-
<DBBrand>Default Brand</DBBrand>
|
|
15
|
-
<h2>2. Icon Visibility</h2>
|
|
16
|
-
<DBBrand showIcon={false}>Icon Hidden</DBBrand>
|
|
17
|
-
<h2>3. Custom Text</h2>
|
|
18
|
-
<DBBrand text="Custom Brand Text">With Custom Text</DBBrand>
|
|
19
|
-
</>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default Brand;
|
|
24
|
-
```
|
package/agent/Button.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Button Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBButton } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Button(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBButton Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Button</h2>
|
|
14
|
-
<DBButton>Button</DBButton>
|
|
15
|
-
<h2>2. Variants</h2>
|
|
16
|
-
<DBButton variant="filled">Filled</DBButton>
|
|
17
|
-
<DBButton variant="outlined">Outlined</DBButton>
|
|
18
|
-
<DBButton variant="ghost">Ghost</DBButton>
|
|
19
|
-
<DBButton variant="brand">Brand</DBButton>
|
|
20
|
-
<h2>3. Sizes</h2>
|
|
21
|
-
<DBButton size="small">Small</DBButton>
|
|
22
|
-
<DBButton size="medium">Medium</DBButton>
|
|
23
|
-
<h2>4. Icon Only</h2>
|
|
24
|
-
<DBButton icon="check" noText />
|
|
25
|
-
<h2>5. Disabled</h2>
|
|
26
|
-
<DBButton disabled>Disabled</DBButton>
|
|
27
|
-
<h2>6. Button Types</h2>
|
|
28
|
-
<DBButton type="button">Type=button</DBButton>
|
|
29
|
-
<DBButton type="submit">Type=submit</DBButton>
|
|
30
|
-
<DBButton type="reset">Type=reset</DBButton>
|
|
31
|
-
<h2>7. Form Association</h2>
|
|
32
|
-
<form id="example-form">
|
|
33
|
-
<input name="exampleInput" placeholder="Example input" />
|
|
34
|
-
</form>
|
|
35
|
-
<DBButton form="example-form" type="submit">
|
|
36
|
-
Submit Form
|
|
37
|
-
</DBButton>
|
|
38
|
-
<h2>8. Name & Value</h2>
|
|
39
|
-
<DBButton name="testName" value="testValue">
|
|
40
|
-
Name/Value
|
|
41
|
-
</DBButton>
|
|
42
|
-
<h2>9. Width</h2>
|
|
43
|
-
<DBButton width="full">Full width</DBButton>
|
|
44
|
-
<DBButton width="auto">Auto width</DBButton>
|
|
45
|
-
<h2>10. Icon Visibility</h2>
|
|
46
|
-
<DBButton icon="check" showIcon={false}>
|
|
47
|
-
Icon Hidden
|
|
48
|
-
</DBButton>
|
|
49
|
-
<h2>11. Custom Class</h2>
|
|
50
|
-
<DBButton className="my-custom-class">Custom Class</DBButton>
|
|
51
|
-
<h2>12. Click Event</h2>
|
|
52
|
-
<DBButton onClick={(event) => alert("Button clicked!")}>
|
|
53
|
-
Click Me
|
|
54
|
-
</DBButton>
|
|
55
|
-
</>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export default Button;
|
|
60
|
-
```
|
package/agent/Card.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Card Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBCard } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Card(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBCard Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Card</h2>
|
|
14
|
-
<DBCard>Default Card</DBCard>
|
|
15
|
-
<h2>2. Behaviors</h2>
|
|
16
|
-
<DBCard behavior="static">Static</DBCard>
|
|
17
|
-
<DBCard behavior="interactive">Interactive</DBCard>
|
|
18
|
-
<h2>3. Elevation Levels</h2>
|
|
19
|
-
<DBCard elevationLevel="1">Elevation Level 1</DBCard>
|
|
20
|
-
<DBCard elevationLevel="2">Elevation Level 2</DBCard>
|
|
21
|
-
<DBCard elevationLevel="3">Elevation Level 3</DBCard>
|
|
22
|
-
<h2>4. Custom Class</h2>
|
|
23
|
-
<DBCard className="my-custom-class">Custom Class</DBCard>
|
|
24
|
-
<h2>5. Spacing</h2>
|
|
25
|
-
<DBCard spacing="medium">Medium Spacing</DBCard>
|
|
26
|
-
<DBCard spacing="small">Small Spacing</DBCard>
|
|
27
|
-
<DBCard spacing="large">Large Spacing</DBCard>
|
|
28
|
-
<DBCard spacing="none">No Spacing</DBCard>
|
|
29
|
-
</>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default Card;
|
|
34
|
-
```
|
package/agent/Checkbox.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Checkbox Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBCheckbox } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Checkbox(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBCheckbox Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Checkbox</h2>
|
|
14
|
-
<DBCheckbox label="Default Checkbox" />
|
|
15
|
-
<h2>2. Indeterminate State</h2>
|
|
16
|
-
<DBCheckbox label="Indeterminate Checkbox" indeterminate />
|
|
17
|
-
<h2>3. Sizes</h2>
|
|
18
|
-
<DBCheckbox size="small" label="Small Checkbox" />
|
|
19
|
-
<DBCheckbox size="medium" label="Medium Checkbox" />
|
|
20
|
-
<h2>4. Validation States</h2>
|
|
21
|
-
<DBCheckbox validation="valid" label="Valid Checkbox" />
|
|
22
|
-
<DBCheckbox validation="invalid" label="Invalid Checkbox" />
|
|
23
|
-
<DBCheckbox validation="no-validation" label="No Validation Checkbox" />
|
|
24
|
-
<h2>5. Disabled State</h2>
|
|
25
|
-
<DBCheckbox label="Disabled Checkbox" disabled />
|
|
26
|
-
<h2>6. Message Property Example</h2>
|
|
27
|
-
<DBCheckbox
|
|
28
|
-
label="Checkbox with Message"
|
|
29
|
-
message="This is a helper message."
|
|
30
|
-
/>
|
|
31
|
-
<h2>7. Change Event Example</h2>
|
|
32
|
-
<DBCheckbox
|
|
33
|
-
label="Change Event"
|
|
34
|
-
onChange={(event) => console.log("Change event:", event.target.checked)}
|
|
35
|
-
/>
|
|
36
|
-
</>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default Checkbox;
|
|
41
|
-
```
|
package/agent/CustomSelect.md
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# CustomSelect Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBCustomSelect } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function CustomSelect(props: any) {
|
|
10
|
-
function getOptions() {
|
|
11
|
-
return [
|
|
12
|
-
{
|
|
13
|
-
value: "1",
|
|
14
|
-
label: "Option 1",
|
|
15
|
-
selected: false,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: "2",
|
|
19
|
-
label: "Option 2",
|
|
20
|
-
disabled: true,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
value: "3",
|
|
24
|
-
label: "Option 3",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
<h1>DBCustomSelect Documentation Examples</h1>
|
|
32
|
-
<h2>1. Default Custom Select</h2>
|
|
33
|
-
<DBCustomSelect label="Default Custom Select" options={getOptions()} />
|
|
34
|
-
<h2>3. Multiple Select</h2>
|
|
35
|
-
<DBCustomSelect
|
|
36
|
-
label="Multiple Custom Select"
|
|
37
|
-
multiple
|
|
38
|
-
options={getOptions()}
|
|
39
|
-
/>
|
|
40
|
-
<h2>4. Disabled State</h2>
|
|
41
|
-
<DBCustomSelect
|
|
42
|
-
label="Disabled Custom Select"
|
|
43
|
-
disabled
|
|
44
|
-
options={getOptions()}
|
|
45
|
-
/>
|
|
46
|
-
<h2>5. Validation States</h2>
|
|
47
|
-
<DBCustomSelect
|
|
48
|
-
validMessage="This is a valid selection"
|
|
49
|
-
validation="valid"
|
|
50
|
-
label="Valid Custom Select"
|
|
51
|
-
options={getOptions()}
|
|
52
|
-
/>
|
|
53
|
-
<DBCustomSelect
|
|
54
|
-
invalidMessage="This is an invalid selection"
|
|
55
|
-
validation="invalid"
|
|
56
|
-
label="Invalid Custom Select"
|
|
57
|
-
options={getOptions()}
|
|
58
|
-
/>
|
|
59
|
-
<DBCustomSelect
|
|
60
|
-
validation="no-validation"
|
|
61
|
-
label="No Validation Custom Select"
|
|
62
|
-
options={getOptions()}
|
|
63
|
-
/>
|
|
64
|
-
<h2>6. Change Event Example</h2>
|
|
65
|
-
<DBCustomSelect
|
|
66
|
-
label="Change Event"
|
|
67
|
-
onChange={(event) => console.log("Change event:", event.target.value)}
|
|
68
|
-
options={getOptions()}
|
|
69
|
-
/>
|
|
70
|
-
<h2>7. Placeholder Example</h2>
|
|
71
|
-
<DBCustomSelect
|
|
72
|
-
label="Custom Select with Placeholder"
|
|
73
|
-
placeholder="Select an option"
|
|
74
|
-
options={getOptions()}
|
|
75
|
-
/>
|
|
76
|
-
</>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default CustomSelect;
|
|
81
|
-
```
|
package/agent/Divider.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Divider Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBDivider } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Divider(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBDivider Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Divider</h2>
|
|
14
|
-
<DBDivider />
|
|
15
|
-
<h2>2. Margin Variants</h2>
|
|
16
|
-
<DBDivider margin="none" />
|
|
17
|
-
<DBDivider margin="_" />
|
|
18
|
-
<h2>3. Orientation Variants</h2>
|
|
19
|
-
<DBDivider variant="horizontal" />
|
|
20
|
-
<DBDivider variant="vertical" />
|
|
21
|
-
<h2>4. Emphasis Variants</h2>
|
|
22
|
-
<DBDivider emphasis="weak" />
|
|
23
|
-
<DBDivider emphasis="strong" />
|
|
24
|
-
<h2>5. Width Variants</h2>
|
|
25
|
-
<DBDivider width="full" />
|
|
26
|
-
<DBDivider width="auto" />
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default Divider;
|
|
32
|
-
```
|
package/agent/Drawer.md
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
## CSS Properties
|
|
2
|
-
|
|
3
|
-
| CSS Variable | Default | CSS Property | Description | Example |
|
|
4
|
-
| --- | --- | --- | --- | --- |
|
|
5
|
-
| `--db-drawer-max-height` | `calc(100% - #{variables.$db-spacing-fixed-xl})` | max-block-size | Sets the maximum height of the drawer | — |
|
|
6
|
-
| `--db-drawer-header-padding-block-end` | `#{map.get($spacing, "block")}` | padding-block-end | Controls the bottom padding inside the drawer header | — |
|
|
7
|
-
| `--db-drawer-content-padding-inline` | `#{map.get($spacing, "inline")}` | padding-inline | Controls left/right padding inside the drawer content area | — |
|
|
8
|
-
| `--db-drawer-max-width` | `calc(100% - #{variables.$db-spacing-fixed-xl})` | max-inline-size | Sets the maximum width of the drawer and some default values for the drawer | <pre>css - Wide drawer<br>.db-drawer-wide {<br>--db-drawer-max-width: 800px;<br>}<br><div class="db-drawer db-drawer-wide"><br><!-- wide drawer --><br></div><br></pre> |
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Drawer Examples (react)
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
"use client";
|
|
15
|
-
import * as React from "react";
|
|
16
|
-
import { useState } from "react";
|
|
17
|
-
import { DBButton } from "@db-ux/react-react-core-components";
|
|
18
|
-
import { DBDrawer } from "@db-ux/react-react-core-components";
|
|
19
|
-
|
|
20
|
-
function Drawer(props: any) {
|
|
21
|
-
const [open, setOpen] = useState<boolean>(() => false);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<>
|
|
25
|
-
<h1>DBDrawer Documentation Examples</h1>
|
|
26
|
-
<h2>1. Default Drawer</h2>
|
|
27
|
-
<div>
|
|
28
|
-
<DBButton
|
|
29
|
-
onClick={(event) => {
|
|
30
|
-
setOpen(true);
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
Open Me
|
|
34
|
-
</DBButton>
|
|
35
|
-
<DBDrawer
|
|
36
|
-
open={open}
|
|
37
|
-
onClose={(event) => {
|
|
38
|
-
setOpen(false);
|
|
39
|
-
}}
|
|
40
|
-
drawerHeader={<header>Optional drawer header</header>}
|
|
41
|
-
>
|
|
42
|
-
My Drawer content
|
|
43
|
-
</DBDrawer>
|
|
44
|
-
</div>
|
|
45
|
-
<h2>2. Drawer Variants</h2>
|
|
46
|
-
<div>
|
|
47
|
-
<DBButton
|
|
48
|
-
onClick={(event) => {
|
|
49
|
-
setOpen(true);
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
Open Modal Drawer
|
|
53
|
-
</DBButton>
|
|
54
|
-
<DBDrawer
|
|
55
|
-
variant="modal"
|
|
56
|
-
open={open}
|
|
57
|
-
onClose={(event) => {
|
|
58
|
-
setOpen(false);
|
|
59
|
-
}}
|
|
60
|
-
>
|
|
61
|
-
Modal Drawer content
|
|
62
|
-
</DBDrawer>
|
|
63
|
-
</div>
|
|
64
|
-
<div>
|
|
65
|
-
<DBButton
|
|
66
|
-
onClick={(event) => {
|
|
67
|
-
setOpen(true);
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
Open Inside Drawer
|
|
71
|
-
</DBButton>
|
|
72
|
-
<DBDrawer
|
|
73
|
-
variant="inside"
|
|
74
|
-
open={open}
|
|
75
|
-
onClose={(event) => {
|
|
76
|
-
setOpen(false);
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
Inside Drawer content
|
|
80
|
-
</DBDrawer>
|
|
81
|
-
</div>
|
|
82
|
-
</>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default Drawer;
|
|
87
|
-
```
|
package/agent/Header.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Header Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
"use client";
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import { useState } from "react";
|
|
9
|
-
import { DBNavigation } from "@db-ux/react-react-core-components";
|
|
10
|
-
import { DBNavigationItem } from "@db-ux/react-react-core-components";
|
|
11
|
-
import { DBHeader } from "@db-ux/react-react-core-components";
|
|
12
|
-
|
|
13
|
-
function Header(props: any) {
|
|
14
|
-
const [drawerOpen, setDrawerOpen] = useState<boolean>(() => false);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<h1>DBHeader Documentation Examples</h1>
|
|
19
|
-
<h2>1. Default Header</h2>
|
|
20
|
-
<DBHeader
|
|
21
|
-
drawerOpen={drawerOpen}
|
|
22
|
-
onToggle={(open) => setDrawerOpen(open)}
|
|
23
|
-
brand={<DBBrand>My Awesome App</DBBrand>}
|
|
24
|
-
metaNavigation={<><DBLink href="#">Imprint</DBLink><DBLink href="#">Help</DBLink></>}
|
|
25
|
-
primaryAction={<DBButton icon="magnifying_glass" variant="ghost" noText>Search</DBButton>}
|
|
26
|
-
secondaryAction={<><DBButton icon="x_placeholder" variant="ghost" noText>Profile</DBButton><DBButton icon="alert" variant="ghost" noText>Notification</DBButton><DBButton icon="help" variant="ghost" noText>Help</DBButton></>}
|
|
27
|
-
>
|
|
28
|
-
<DBNavigation>
|
|
29
|
-
<DBNavigationItem>
|
|
30
|
-
<a href="#">Navi-Item 1</a>
|
|
31
|
-
</DBNavigationItem>
|
|
32
|
-
<DBNavigationItem icon="x_placeholder">
|
|
33
|
-
<a href="#">Navi-Item 2</a>
|
|
34
|
-
</DBNavigationItem>
|
|
35
|
-
<DBNavigationItem disabled>
|
|
36
|
-
<a href="#">Navi-Item 3</a>
|
|
37
|
-
</DBNavigationItem>
|
|
38
|
-
</DBNavigation>
|
|
39
|
-
</DBHeader>
|
|
40
|
-
</>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default Header;
|
|
45
|
-
```
|
package/agent/Icon.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Icon Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBIcon } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Icon(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBIcon Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Icon</h2>
|
|
14
|
-
<DBIcon>Default Icon</DBIcon>
|
|
15
|
-
<h2>2. Icon Variants</h2>
|
|
16
|
-
<DBIcon icon="user">User Icon</DBIcon>
|
|
17
|
-
<DBIcon icon="settings">Settings Icon</DBIcon>
|
|
18
|
-
<h2>3. Icon Weights</h2>
|
|
19
|
-
<DBIcon weight="16">16px Icon</DBIcon>
|
|
20
|
-
<DBIcon weight="24">24px Icon</DBIcon>
|
|
21
|
-
<DBIcon weight="32">32px Icon</DBIcon>
|
|
22
|
-
<h2>4. Custom Class</h2>
|
|
23
|
-
<DBIcon className="my-custom-class">Custom Class Icon</DBIcon>
|
|
24
|
-
<h2>5. Text Content</h2>
|
|
25
|
-
<DBIcon text="Icon with Text">Icon with Text</DBIcon>
|
|
26
|
-
</>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default Icon;
|
|
31
|
-
```
|