@db-ux/react-core-components 3.1.17 → 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/README.md
CHANGED
|
@@ -59,6 +59,17 @@ import { DBButton } from '@db-ux/react-core-components';
|
|
|
59
59
|
...
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
## Documentation for AI Agents
|
|
63
|
+
|
|
64
|
+
We provide a documentation for every component in the DB UX Design System via `docs` folder.
|
|
65
|
+
To consume those documentation for AI Agents (currently GitHub Copilot) the best way is to copy the `docs` folder into your project.
|
|
66
|
+
|
|
67
|
+
We provide a [CLI tool (`@db-ux/agent-cli`)](https://www.npmjs.com/package/@db-ux/agent-cli) to do this automatically, which you can run with:
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
npx @db-ux/agent-cli
|
|
71
|
+
```
|
|
72
|
+
|
|
62
73
|
## Deutsche Bahn brand
|
|
63
74
|
|
|
64
75
|
As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound of clear guidelines and restrictions even if being used with the code that we're providing with this product; Deutsche Bahn fully reserves all rights regarding the Deutsche Bahn brand, even though that we're providing the code of DB UX Design System products free to use and release it under the Apache 2.0 license.
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,81 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Infotext Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBInfotext } from "@db-ux/react-react-core-components";
|
|
8
|
+
|
|
9
|
+
function Infotext(props: any) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<h1>DBInfotext Documentation Examples</h1>
|
|
13
|
+
<h2>1. Default Infotext</h2>
|
|
14
|
+
<DBInfotext>Default Infotext</DBInfotext>
|
|
15
|
+
<h2>2. Semantic Variants</h2>
|
|
16
|
+
<DBInfotext semantic="adaptive">Adaptive</DBInfotext>
|
|
17
|
+
<DBInfotext semantic="neutral">Neutral</DBInfotext>
|
|
18
|
+
<DBInfotext semantic="critical">Critical</DBInfotext>
|
|
19
|
+
<DBInfotext semantic="informational">Informational</DBInfotext>
|
|
20
|
+
<DBInfotext semantic="warning">Warning</DBInfotext>
|
|
21
|
+
<DBInfotext semantic="successful">Successful</DBInfotext>
|
|
22
|
+
<h2>3. Sizes</h2>
|
|
23
|
+
<DBInfotext size="small">Small</DBInfotext>
|
|
24
|
+
<DBInfotext size="medium">Medium</DBInfotext>
|
|
25
|
+
<h2>4. Icon Visibility</h2>
|
|
26
|
+
<DBInfotext icon="info" showIcon={false}>
|
|
27
|
+
Icon Hidden
|
|
28
|
+
</DBInfotext>
|
|
29
|
+
<h2>5. Custom Class</h2>
|
|
30
|
+
<DBInfotext className="my-custom-class">Custom Class</DBInfotext>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default Infotext;
|
|
36
|
+
```
|
package/agent/Input.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Input Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBInput } from "@db-ux/react-react-core-components";
|
|
8
|
+
|
|
9
|
+
function Input(props: any) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<h1>DBInput Documentation Examples</h1>
|
|
13
|
+
<h2>1. Default Input</h2>
|
|
14
|
+
<DBInput label="Enter text here" />
|
|
15
|
+
<h2>2. Input Types</h2>
|
|
16
|
+
<DBInput type="text" label="Text Input" />
|
|
17
|
+
<DBInput type="email" label="Email Input" />
|
|
18
|
+
<DBInput type="password" label="Password Input" />
|
|
19
|
+
<DBInput type="number" label="Number Input" />
|
|
20
|
+
<h2>3. Sizes</h2>
|
|
21
|
+
<DBInput size="small" label="Small Input" />
|
|
22
|
+
<DBInput size="medium" label="Medium Input" />
|
|
23
|
+
<h2>4. Icon Support</h2>
|
|
24
|
+
<DBInput icon="search" label="Search Input" />
|
|
25
|
+
<DBInput iconLeading="user" label="Leading Icon" />
|
|
26
|
+
<DBInput iconTrailing="check" label="Trailing Icon" />
|
|
27
|
+
<h2>5. Validation States</h2>
|
|
28
|
+
<DBInput validation="valid" label="Valid Input" />
|
|
29
|
+
<DBInput validation="invalid" label="Invalid Input" />
|
|
30
|
+
<DBInput validation="no-validation" label="No Validation" />
|
|
31
|
+
<h2>6. Disabled State</h2>
|
|
32
|
+
<DBInput label="Disabled Input" disabled />
|
|
33
|
+
<h2>7. Custom Class</h2>
|
|
34
|
+
<DBInput className="my-custom-class" label="Custom Class" />
|
|
35
|
+
<h2>8. Placeholder Examples</h2>
|
|
36
|
+
<DBInput placeholder="Enter text here" label="With Placeholder" />
|
|
37
|
+
<DBInput placeholder="Search here" label="Search Placeholder" />
|
|
38
|
+
<h2>9. Input Event Example</h2>
|
|
39
|
+
<DBInput
|
|
40
|
+
label="Input Event"
|
|
41
|
+
onInput={(event) => console.log("Input event:", event.target.value)}
|
|
42
|
+
/>
|
|
43
|
+
<h2>10. Message Property Example</h2>
|
|
44
|
+
<DBInput label="Input with Message" message="This is a helper message." />
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default Input;
|
|
50
|
+
```
|