@db-ux/react-core-components 1.0.0-test-13b991d
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 +76 -0
- package/dist/components/accordion/accordion.d.ts +3 -0
- package/dist/components/accordion/accordion.js +92 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/model.d.ts +41 -0
- package/dist/components/accordion/model.js +2 -0
- package/dist/components/accordion-item/accordion-item.d.ts +8 -0
- package/dist/components/accordion-item/accordion-item.js +34 -0
- package/dist/components/accordion-item/index.d.ts +1 -0
- package/dist/components/accordion-item/index.js +1 -0
- package/dist/components/accordion-item/model.d.ts +24 -0
- package/dist/components/accordion-item/model.js +1 -0
- package/dist/components/badge/badge.d.ts +3 -0
- package/dist/components/badge/badge.js +32 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/badge/model.d.ts +16 -0
- package/dist/components/badge/model.js +1 -0
- package/dist/components/brand/brand.d.ts +3 -0
- package/dist/components/brand/brand.js +13 -0
- package/dist/components/brand/index.d.ts +1 -0
- package/dist/components/brand/index.js +1 -0
- package/dist/components/brand/model.d.ts +10 -0
- package/dist/components/brand/model.js +1 -0
- package/dist/components/button/button.d.ts +3 -0
- package/dist/components/button/button.js +16 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/model.d.ts +52 -0
- package/dist/components/button/model.js +3 -0
- package/dist/components/card/card.d.ts +3 -0
- package/dist/components/card/card.js +16 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/model.d.ts +18 -0
- package/dist/components/card/model.js +2 -0
- package/dist/components/checkbox/checkbox.d.ts +3 -0
- package/dist/components/checkbox/checkbox.js +112 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/model.d.ts +10 -0
- package/dist/components/checkbox/model.js +1 -0
- package/dist/components/divider/divider.d.ts +3 -0
- package/dist/components/divider/divider.js +11 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/divider/model.d.ts +18 -0
- package/dist/components/divider/model.js +2 -0
- package/dist/components/drawer/drawer.d.ts +3 -0
- package/dist/components/drawer/drawer.js +70 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/drawer/model.d.ts +41 -0
- package/dist/components/drawer/model.js +3 -0
- package/dist/components/header/header.d.ts +3 -0
- package/dist/components/header/header.js +68 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/header/model.d.ts +44 -0
- package/dist/components/header/model.js +1 -0
- package/dist/components/icon/icon.d.ts +3 -0
- package/dist/components/icon/icon.js +11 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/icon/model.d.ts +12 -0
- package/dist/components/icon/model.js +2 -0
- package/dist/components/infotext/index.d.ts +1 -0
- package/dist/components/infotext/index.js +1 -0
- package/dist/components/infotext/infotext.d.ts +3 -0
- package/dist/components/infotext/infotext.js +12 -0
- package/dist/components/infotext/model.d.ts +5 -0
- package/dist/components/infotext/model.js +1 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input.d.ts +3 -0
- package/dist/components/input/input.js +119 -0
- package/dist/components/input/model.d.ts +39 -0
- package/dist/components/input/model.js +5 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/index.js +1 -0
- package/dist/components/link/link.d.ts +3 -0
- package/dist/components/link/link.js +17 -0
- package/dist/components/link/model.d.ts +24 -0
- package/dist/components/link/model.js +3 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/navigation/index.js +1 -0
- package/dist/components/navigation/model.d.ts +5 -0
- package/dist/components/navigation/model.js +1 -0
- package/dist/components/navigation/navigation.d.ts +3 -0
- package/dist/components/navigation/navigation.js +17 -0
- package/dist/components/navigation-item/index.d.ts +1 -0
- package/dist/components/navigation-item/index.js +1 -0
- package/dist/components/navigation-item/model.d.ts +34 -0
- package/dist/components/navigation-item/model.js +1 -0
- package/dist/components/navigation-item/navigation-item.d.ts +3 -0
- package/dist/components/navigation-item/navigation-item.js +68 -0
- package/dist/components/notification/index.d.ts +1 -0
- package/dist/components/notification/index.js +1 -0
- package/dist/components/notification/model.d.ts +57 -0
- package/dist/components/notification/model.js +3 -0
- package/dist/components/notification/notification.d.ts +3 -0
- package/dist/components/notification/notification.js +25 -0
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/index.js +1 -0
- package/dist/components/page/model.d.ts +32 -0
- package/dist/components/page/model.js +2 -0
- package/dist/components/page/page.d.ts +3 -0
- package/dist/components/page/page.js +47 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/model.d.ts +18 -0
- package/dist/components/popover/model.js +1 -0
- package/dist/components/popover/popover.d.ts +3 -0
- package/dist/components/popover/popover.js +74 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio/model.d.ts +7 -0
- package/dist/components/radio/model.js +1 -0
- package/dist/components/radio/radio.d.ts +3 -0
- package/dist/components/radio/radio.js +54 -0
- package/dist/components/section/index.d.ts +1 -0
- package/dist/components/section/index.js +1 -0
- package/dist/components/section/model.d.ts +5 -0
- package/dist/components/section/model.js +1 -0
- package/dist/components/section/section.d.ts +3 -0
- package/dist/components/section/section.js +16 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/model.d.ts +43 -0
- package/dist/components/select/model.js +1 -0
- package/dist/components/select/select.d.ts +3 -0
- package/dist/components/select/select.js +132 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stack/model.d.ts +34 -0
- package/dist/components/stack/model.js +4 -0
- package/dist/components/stack/stack.d.ts +3 -0
- package/dist/components/stack/stack.js +11 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/model.d.ts +12 -0
- package/dist/components/switch/model.js +1 -0
- package/dist/components/switch/switch.d.ts +3 -0
- package/dist/components/switch/switch.js +47 -0
- package/dist/components/tab-item/index.d.ts +1 -0
- package/dist/components/tab-item/index.js +1 -0
- package/dist/components/tab-item/model.d.ts +24 -0
- package/dist/components/tab-item/model.js +1 -0
- package/dist/components/tab-item/tab-item.d.ts +3 -0
- package/dist/components/tab-item/tab-item.js +37 -0
- package/dist/components/tab-list/index.d.ts +1 -0
- package/dist/components/tab-list/index.js +1 -0
- package/dist/components/tab-list/model.d.ts +5 -0
- package/dist/components/tab-list/model.js +1 -0
- package/dist/components/tab-list/tab-list.d.ts +3 -0
- package/dist/components/tab-list/tab-list.js +17 -0
- package/dist/components/tab-panel/index.d.ts +1 -0
- package/dist/components/tab-panel/index.js +1 -0
- package/dist/components/tab-panel/model.d.ts +10 -0
- package/dist/components/tab-panel/model.js +1 -0
- package/dist/components/tab-panel/tab-panel.d.ts +3 -0
- package/dist/components/tab-panel/tab-panel.js +14 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/model.d.ts +47 -0
- package/dist/components/tabs/model.js +2 -0
- package/dist/components/tabs/tabs.d.ts +3 -0
- package/dist/components/tabs/tabs.js +138 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/model.d.ts +45 -0
- package/dist/components/tag/model.js +1 -0
- package/dist/components/tag/tag.d.ts +3 -0
- package/dist/components/tag/tag.js +46 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/model.d.ts +30 -0
- package/dist/components/textarea/model.js +2 -0
- package/dist/components/textarea/textarea.d.ts +3 -0
- package/dist/components/textarea/textarea.js +105 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/model.d.ts +7 -0
- package/dist/components/tooltip/model.js +1 -0
- package/dist/components/tooltip/tooltip.d.ts +3 -0
- package/dist/components/tooltip/tooltip.js +43 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/shared/constants.d.ts +83 -0
- package/dist/shared/constants.js +87 -0
- package/dist/shared/model.d.ts +446 -0
- package/dist/shared/model.js +20 -0
- package/dist/utils/form-components.d.ts +2 -0
- package/dist/utils/form-components.js +10 -0
- package/dist/utils/index.d.ts +61 -0
- package/dist/utils/index.js +166 -0
- package/dist/utils/navigation.d.ts +32 -0
- package/dist/utils/navigation.js +136 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @db-ux/react-core-components
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
[](https://github.com/prettier/prettier)
|
|
5
|
+
[](https://conventionalcommits.org)
|
|
6
|
+
[](https://makeapullrequest.com)
|
|
7
|
+
|
|
8
|
+
A React library containing all styles & components of [DB UX Design System (technical components)](https://github.com/db-ux-design-system/core-web).
|
|
9
|
+
|
|
10
|
+
> **Note:** Find more information about specific components [here](https://db-ux-design-system.github.io/core-web/review/main)
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```shell
|
|
15
|
+
npm i @db-ux/react-core-components
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> **Note:** This will install [`@db-ux/core-foundations`](https://www.npmjs.com/package/@db-ux/core-foundations) and [`@db-ux/core-components`](https://www.npmjs.com/package/@db-ux/core-components) as well which contains the `css`/`scss` files
|
|
19
|
+
|
|
20
|
+
## Styling Dependencies
|
|
21
|
+
|
|
22
|
+
Import the styles in scss or css. Based on your technology the file names could be different.
|
|
23
|
+
|
|
24
|
+
- Default (relative): points to `../assets`
|
|
25
|
+
- Rollup (rollup): points to `@db-ux/core-foundations/assets`
|
|
26
|
+
- Webpack (webpack): points to `~@db-ux/core-foundations/assets`
|
|
27
|
+
|
|
28
|
+
<details>
|
|
29
|
+
<summary><strong>SCSS</strong></summary>
|
|
30
|
+
|
|
31
|
+
```scss
|
|
32
|
+
// index.scss
|
|
33
|
+
@forward "@db-ux/core-components/build/styles/rollup";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
</details>
|
|
37
|
+
<details>
|
|
38
|
+
<summary><strong>CSS</strong></summary>
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// main.tsx
|
|
42
|
+
import "@db-ux/core-components/build/styles/rollup.css";
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
47
|
+
> **Note:** The `@db-ux/core-components/build/styles/relative` file contains optional and all components styles. If you consider performance issues see [@db-ux/core-components](https://www.npmjs.com/package/@db-ux/core-components) for more information.
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { DBButton } from '@db-ux/react-core-components';
|
|
53
|
+
...
|
|
54
|
+
<DBButton icon="x_placeholder" onClick={()=>{console.log("Test")}}>Test</DBButton>
|
|
55
|
+
...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Deutsche Bahn brand
|
|
59
|
+
|
|
60
|
+
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 when being used with the code that we're provide 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.
|
|
61
|
+
Please have a look at our brand portal at <https://marketingportal.extranet.deutschebahn.com/> for any further questions and whom to contact on any brand issues.
|
|
62
|
+
|
|
63
|
+
You must remove or replace any Deutsche Bahn brand and design assets as well as protected characteristics and trademarks. We're even also planning to provide a neutral theme that would make it much easier for you to use our product without the trademarks by Deutsche Bahn.
|
|
64
|
+
|
|
65
|
+
## Contributions
|
|
66
|
+
|
|
67
|
+
Contributions are very welcome, please refer to the [contribution guide](https://github.com/db-ux-design-system/core-web/blob/main/CONTRIBUTING.md).
|
|
68
|
+
|
|
69
|
+
## Code of conduct
|
|
70
|
+
|
|
71
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
72
|
+
community a harassment-free experience for everyone – have a look at our [Contributor Covenant Code of Conduct](https://github.com/db-ux-design-system/core-web/blob/main/CODE-OF-CONDUCT.md).
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
This project is licensed under [Apache-2.0](LICENSE).
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBAccordion: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLUListElement>, keyof import("../..").GlobalProps | keyof import("./model").DBAccordionDefaultProps> & import("./model").DBAccordionDefaultProps & import("../..").GlobalProps & React.RefAttributes<HTMLUListElement>>;
|
|
3
|
+
export default DBAccordion;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
4
|
+
import { cls, uuid, filterPassingProps, getRootProps } from "../../utils";
|
|
5
|
+
import DBAccordionItem from "../accordion-item/accordion-item";
|
|
6
|
+
import { DEFAULT_ID } from "../../shared/constants";
|
|
7
|
+
function DBAccordionFn(props, component) {
|
|
8
|
+
var _a;
|
|
9
|
+
const _ref = component || useRef(component);
|
|
10
|
+
const [_id, set_id] = useState(() => DEFAULT_ID);
|
|
11
|
+
const [_name, set_name] = useState(() => "");
|
|
12
|
+
const [initialized, setInitialized] = useState(() => false);
|
|
13
|
+
const [_initOpenIndexDone, set_initOpenIndexDone] = useState(() => false);
|
|
14
|
+
function convertItems(items) {
|
|
15
|
+
try {
|
|
16
|
+
if (typeof items === "string") {
|
|
17
|
+
return JSON.parse(items);
|
|
18
|
+
}
|
|
19
|
+
return items;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error(error);
|
|
23
|
+
}
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
set_id(props.id || "accordion-" + uuid());
|
|
28
|
+
setInitialized(true);
|
|
29
|
+
set_initOpenIndexDone(true);
|
|
30
|
+
}, []);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
// If we have a single behavior we first check for
|
|
33
|
+
// props.name otherwise for state_id
|
|
34
|
+
if (initialized) {
|
|
35
|
+
if (props.behavior === "single") {
|
|
36
|
+
if (props.name) {
|
|
37
|
+
if (_name !== props.name) {
|
|
38
|
+
set_name(props.name);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (_name !== _id && _id) {
|
|
43
|
+
set_name(_id);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
set_name("");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, [initialized, props.name, props.behavior, _id]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (_ref.current) {
|
|
54
|
+
const childDetails = _ref.current.getElementsByTagName("details");
|
|
55
|
+
if (childDetails) {
|
|
56
|
+
for (const details of Array.from(childDetails)) {
|
|
57
|
+
if (_name === "") {
|
|
58
|
+
details.removeAttribute("name");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
details.name = _name;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, [_ref.current, _name]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
var _a;
|
|
69
|
+
if (_ref.current && _initOpenIndexDone) {
|
|
70
|
+
if ((props === null || props === void 0 ? void 0 : props.initOpenIndex) && ((_a = props.initOpenIndex) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
71
|
+
const childDetails = _ref.current.getElementsByTagName("details");
|
|
72
|
+
if (childDetails) {
|
|
73
|
+
const initOpenIndex = props.behavior === "single" && props.initOpenIndex.length > 1
|
|
74
|
+
? [props.initOpenIndex[0]] // use only one index for behavior=single
|
|
75
|
+
: props.initOpenIndex;
|
|
76
|
+
Array.from(childDetails).forEach((details, index) => {
|
|
77
|
+
if (initOpenIndex.includes(index)) {
|
|
78
|
+
details.open = true;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
set_initOpenIndexDone(false);
|
|
84
|
+
}
|
|
85
|
+
}, [_ref.current, _initOpenIndexDone, props.initOpenIndex]);
|
|
86
|
+
return (React.createElement("ul", 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"]), { 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-accordion", props.className), "data-variant": props.variant }),
|
|
87
|
+
!props.items ? React.createElement(React.Fragment, null, props.children) : null,
|
|
88
|
+
props.items ? (React.createElement(React.Fragment, null, (_a = convertItems(props.items)) === null || _a === void 0 ? void 0 : _a.map((item, index) => (React.createElement(DBAccordionItem, { key: `accordion-item-${index}`, headlinePlain: item.headlinePlain, disabled: item.disabled, text: item.text }))))) : null));
|
|
89
|
+
}
|
|
90
|
+
const DBAccordion = forwardRef(DBAccordionFn);
|
|
91
|
+
DBAccordion.defaultProps = {};
|
|
92
|
+
export default DBAccordion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBAccordion } from './accordion';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBAccordion } from './accordion';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState, InitializedState } from '../../shared/model';
|
|
2
|
+
import { DBAccordionItemDefaultProps } from '../accordion-item/model';
|
|
3
|
+
export declare const AccordionVariantList: readonly ["divider", "card"];
|
|
4
|
+
export type AccordionVariantType = (typeof AccordionVariantList)[number];
|
|
5
|
+
export declare const AccordionBehaviorList: readonly ["multiple", "single"];
|
|
6
|
+
export type AccordionBehaviorType = (typeof AccordionBehaviorList)[number];
|
|
7
|
+
export type DBAccordionDefaultProps = {
|
|
8
|
+
/**
|
|
9
|
+
* To allow multiple items open at the same time or only 1 item
|
|
10
|
+
*/
|
|
11
|
+
behavior?: AccordionBehaviorType;
|
|
12
|
+
/**
|
|
13
|
+
* The index of items which should be open when loading the accordion
|
|
14
|
+
*/
|
|
15
|
+
initOpenIndex?: number[];
|
|
16
|
+
/**
|
|
17
|
+
* Alternative to pass in a simple representation of accordion items
|
|
18
|
+
*/
|
|
19
|
+
items?: DBAccordionItemDefaultProps[] | string;
|
|
20
|
+
/**
|
|
21
|
+
* Set details name for exclusive accordions, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#name
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Informs about the changes in the internal state, which item is open
|
|
26
|
+
*/
|
|
27
|
+
onChange?: (openAccordionItemIds: string[]) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Defines the display of the accordion and the items:
|
|
30
|
+
* "divider": with a dividing line between the items
|
|
31
|
+
* "card": w/o dividing line, but items are shown in the card variant
|
|
32
|
+
*/
|
|
33
|
+
variant?: AccordionVariantType;
|
|
34
|
+
};
|
|
35
|
+
export type DBAccordionProps = DBAccordionDefaultProps & GlobalProps;
|
|
36
|
+
export type DBAccordionDefaultState = {
|
|
37
|
+
_initOpenIndexDone: boolean;
|
|
38
|
+
_name: string;
|
|
39
|
+
convertItems: (items?: unknown[] | string) => DBAccordionItemDefaultProps[];
|
|
40
|
+
};
|
|
41
|
+
export type DBAccordionState = DBAccordionDefaultState & GlobalState & InitializedState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBAccordionItem: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDetailsElement>, "text" | "disabled" | "onToggle" | keyof import("../../shared/model").GlobalProps | "headline" | "defaultOpen" | "headlinePlain"> & {
|
|
3
|
+
defaultOpen?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
headline?: any;
|
|
6
|
+
headlinePlain?: string;
|
|
7
|
+
} & import("../../shared/model").TextProps & import("../../shared/model").GlobalProps & import("../../shared/model").ToggleEventProps & React.RefAttributes<HTMLDetailsElement>>;
|
|
8
|
+
export default DBAccordionItem;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
4
|
+
import { cls, getBooleanAsString, uuid, filterPassingProps, getRootProps } from "../../utils";
|
|
5
|
+
import { DEFAULT_ID } from "../../shared/constants";
|
|
6
|
+
function DBAccordionItemFn(props, component) {
|
|
7
|
+
const _ref = component || useRef(component);
|
|
8
|
+
const [_id, set_id] = useState(() => DEFAULT_ID);
|
|
9
|
+
const [_open, set_open] = useState(() => false);
|
|
10
|
+
function toggle(event) {
|
|
11
|
+
// We need this for react https://github.com/facebook/react/issues/15486#issuecomment-488028431
|
|
12
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
13
|
+
const newStateOpen = !_open;
|
|
14
|
+
if (props.onToggle) {
|
|
15
|
+
props.onToggle(newStateOpen);
|
|
16
|
+
}
|
|
17
|
+
set_open(newStateOpen);
|
|
18
|
+
}
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
set_id(props.id || "accordion-item-" + uuid());
|
|
21
|
+
if (props.defaultOpen) {
|
|
22
|
+
set_open(props.defaultOpen);
|
|
23
|
+
}
|
|
24
|
+
}, []);
|
|
25
|
+
return (React.createElement("li", Object.assign({ 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-accordion-item", props.className) }),
|
|
26
|
+
React.createElement("details", Object.assign({ "aria-disabled": getBooleanAsString(props.disabled), 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"]), { open: _open }),
|
|
27
|
+
React.createElement("summary", { onClick: (event) => toggle(event) },
|
|
28
|
+
props.headlinePlain ? React.createElement(React.Fragment, null, props.headlinePlain) : null,
|
|
29
|
+
!props.headlinePlain ? React.createElement(React.Fragment, null, props.headline) : null),
|
|
30
|
+
React.createElement("div", null, props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children)))));
|
|
31
|
+
}
|
|
32
|
+
const DBAccordionItem = forwardRef(DBAccordionItemFn);
|
|
33
|
+
DBAccordionItem.defaultProps = {};
|
|
34
|
+
export default DBAccordionItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBAccordionItem } from './accordion-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBAccordionItem } from './accordion-item';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState, TextProps, ToggleEventProps, ToggleEventState } from '../../shared/model';
|
|
2
|
+
export type DBAccordionItemDefaultProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Initial state for the accordion item
|
|
5
|
+
*/
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The disabled attribute can be set to keep a user from clicking on the element.
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Title of the accordion-item as slot
|
|
13
|
+
*/
|
|
14
|
+
headline?: any;
|
|
15
|
+
/**
|
|
16
|
+
* Title of the accordion-item as plain text
|
|
17
|
+
*/
|
|
18
|
+
headlinePlain?: string;
|
|
19
|
+
} & TextProps;
|
|
20
|
+
export type DBAccordionItemProps = DBAccordionItemDefaultProps & GlobalProps & ToggleEventProps;
|
|
21
|
+
export type DBAccordionItemDefaultState = {
|
|
22
|
+
_open: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type DBAccordionItemState = DBAccordionItemDefaultState & GlobalState & ToggleEventState<HTMLElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBBadge: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLSpanElement>, "text" | "size" | keyof import("../..").GlobalProps | "semantic" | keyof import("./model").DBBadgeDefaultProps | "emphasis"> & import("./model").DBBadgeDefaultProps & import("../..").GlobalProps & import("../..").SemanticProps & import("../..").SizeProps & import("../..").TagEmphasisProps & import("../..").TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
3
|
+
export default DBBadge;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
4
|
+
import { cls, filterPassingProps, getRootProps } from "../../utils";
|
|
5
|
+
import { DEFAULT_LABEL } from "../../shared/constants";
|
|
6
|
+
function DBBadgeFn(props, component) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const _ref = component || useRef(component);
|
|
9
|
+
const [initialized, setInitialized] = useState(() => false);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setInitialized(true);
|
|
12
|
+
}, []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
var _a;
|
|
15
|
+
if (_ref.current && initialized) {
|
|
16
|
+
if ((_a = props.placement) === null || _a === void 0 ? void 0 : _a.startsWith("corner")) {
|
|
17
|
+
let parent = _ref.current.parentElement;
|
|
18
|
+
if (parent && parent.localName.includes("badge")) {
|
|
19
|
+
// Angular workaround
|
|
20
|
+
parent = parent.parentElement;
|
|
21
|
+
}
|
|
22
|
+
if (parent) {
|
|
23
|
+
parent.setAttribute("data-has-badge", "true");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, [_ref.current, initialized]);
|
|
28
|
+
return (React.createElement("span", 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"]), { id: props.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-badge", props.className), "data-semantic": props.semantic, "data-size": props.size, "data-emphasis": props.emphasis, "data-placement": props.placement, "data-label": ((_a = props.placement) === null || _a === void 0 ? void 0 : _a.startsWith("corner")) && ((_b = props.label) !== null && _b !== void 0 ? _b : DEFAULT_LABEL) }), props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children)));
|
|
29
|
+
}
|
|
30
|
+
const DBBadge = forwardRef(DBBadgeFn);
|
|
31
|
+
DBBadge.defaultProps = {};
|
|
32
|
+
export default DBBadge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBBadge } from './badge';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBBadge } from './badge';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState, InitializedState, SemanticProps, SizeProps, TagEmphasisProps, TextProps } from '../../shared/model';
|
|
2
|
+
export declare const BadgePlacementList: readonly ["inline", "corner-top-left", "corner-top-right", "corner-center-left", "corner-center-right", "corner-bottom-left", "corner-bottom-right"];
|
|
3
|
+
export type BadgePlacementType = (typeof BadgePlacementList)[number];
|
|
4
|
+
export type DBBadgeDefaultProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The `placement` attributes `corner-*` values change the position to absolute and adds a transform based on the placement.
|
|
7
|
+
*/
|
|
8
|
+
placement?: BadgePlacementType;
|
|
9
|
+
/**
|
|
10
|
+
* Describes the badge for a11y if you use placement attribute with `corner-*`
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
export type DBBadgeProps = DBBadgeDefaultProps & GlobalProps & SemanticProps & SizeProps & TagEmphasisProps & TextProps;
|
|
15
|
+
export type DBBadgeDefaultState = {};
|
|
16
|
+
export type DBBadgeState = DBBadgeDefaultState & GlobalState & InitializedState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const BadgePlacementList = ['inline', 'corner-top-left', 'corner-top-right', 'corner-center-left', 'corner-center-right', 'corner-bottom-left', 'corner-bottom-right'];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBBrand: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "text" | "icon" | keyof import("../..").GlobalProps | "showIcon" | "hideLogo"> & import("./model").DBBrandDefaultProps & import("../..").GlobalProps & import("../..").IconProps & import("../..").ShowIconProps & import("../..").TextProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export default DBBrand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useRef, forwardRef } from "react";
|
|
4
|
+
import { cls, getHideProp, filterPassingProps, getRootProps } from "../../utils";
|
|
5
|
+
import { DEFAULT_ICON } from "../../shared/constants";
|
|
6
|
+
function DBBrandFn(props, component) {
|
|
7
|
+
var _a;
|
|
8
|
+
const _ref = component || useRef(component);
|
|
9
|
+
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"]), { "data-icon": props.hideLogo ? "none" : (_a = props.icon) !== null && _a !== void 0 ? _a : DEFAULT_ICON, "data-hide-icon": getHideProp(props.showIcon), id: props.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-brand", props.className) }), props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children)));
|
|
10
|
+
}
|
|
11
|
+
const DBBrand = forwardRef(DBBrandFn);
|
|
12
|
+
DBBrand.defaultProps = {};
|
|
13
|
+
export default DBBrand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBBrand } from './brand';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBBrand } from './brand';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState, IconProps, ShowIconProps, TextProps } from '../../shared/model';
|
|
2
|
+
export type DBBrandDefaultProps = {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated: Disable the default logo svg to pass in a custom `img`
|
|
5
|
+
*/
|
|
6
|
+
hideLogo?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type DBBrandProps = DBBrandDefaultProps & GlobalProps & IconProps & ShowIconProps & TextProps;
|
|
9
|
+
export type DBBrandDefaultState = {};
|
|
10
|
+
export type DBBrandState = DBBrandDefaultState & GlobalState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBButton: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLButtonElement>, "width" | "text" | "size" | "icon" | "onClick" | keyof import("./model").DBButtonDefaultProps | keyof import("../../shared/model").GlobalProps | "showIcon"> & import("./model").DBButtonDefaultProps & import("../../shared/model").GlobalProps & import("../../shared/model").ClickEventProps<HTMLButtonElement> & import("../../shared/model").IconProps & import("../../shared/model").WidthProps & import("../../shared/model").SizeProps & import("../../shared/model").ShowIconProps & import("../../shared/model").TextProps & React.RefAttributes<HTMLButtonElement>>;
|
|
3
|
+
export default DBButton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useRef, forwardRef } from "react";
|
|
4
|
+
import { cls, getBooleanAsString, getHideProp, filterPassingProps, getRootProps } from "../../utils";
|
|
5
|
+
function DBButtonFn(props, component) {
|
|
6
|
+
const _ref = component || useRef(component);
|
|
7
|
+
function handleClick(event) {
|
|
8
|
+
if (props.onClick) {
|
|
9
|
+
props.onClick(event);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return (React.createElement("button", 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"]), { id: props.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-button", props.className), type: props.type || "button", disabled: props.disabled, "aria-label": props.label, "data-icon": props.icon, "data-hide-icon": getHideProp(props.showIcon), "data-size": props.size, "data-state": props.state, "data-width": props.width, "data-variant": props.variant, "data-no-text": getBooleanAsString(props.noText), name: props.name, value: props.value, "aria-describedby": props.describedbyid, "aria-expanded": props.ariaexpanded, "aria-pressed": props.ariapressed, onClick: (event) => handleClick(event) }), props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children)));
|
|
13
|
+
}
|
|
14
|
+
const DBButton = forwardRef(DBButtonFn);
|
|
15
|
+
DBButton.defaultProps = {};
|
|
16
|
+
export default DBButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBButton } from './button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBButton } from './button';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ClickEventProps, ClickEventState, GlobalProps, GlobalState, IconProps, ShowIconProps, SizeProps, TextProps, WidthProps } from '../../shared/model';
|
|
2
|
+
export declare const ButtonVariantList: readonly ["outlined", "brand", "filled", "ghost"];
|
|
3
|
+
export type ButtonVariantType = (typeof ButtonVariantList)[number];
|
|
4
|
+
export declare const ButtonTypeList: readonly ["button", "reset", "submit"];
|
|
5
|
+
export type ButtonTypeType = (typeof ButtonTypeList)[number];
|
|
6
|
+
export declare const ButtonStateList: readonly ["loading"];
|
|
7
|
+
export type ButtonStateType = (typeof ButtonStateList)[number];
|
|
8
|
+
export type DBButtonDefaultProps = {
|
|
9
|
+
/**
|
|
10
|
+
* If the button controls a grouping of other elements, the ariaexpanded state [indicates whether the controlled grouping is currently expanded or collapsed](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded).
|
|
11
|
+
*/
|
|
12
|
+
ariaexpanded?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Defines the button as a toggle button. The value of [ariapressed describes the state of the button](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed).
|
|
15
|
+
*/
|
|
16
|
+
ariapressed?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The disabled attribute can be set to [keep a user from clicking on the button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled).
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Define the text next to the icon specified via the icon Property to get hidden.
|
|
23
|
+
*/
|
|
24
|
+
noText?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The label represents the [aria-label attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) value of the button
|
|
27
|
+
*/
|
|
28
|
+
label?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The name attribute specifies a [name attributes value](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#name) for the button.
|
|
31
|
+
*/
|
|
32
|
+
name?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The type attribute specifies the [type of button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type).
|
|
35
|
+
*/
|
|
36
|
+
type?: ButtonTypeType;
|
|
37
|
+
/**
|
|
38
|
+
* The value attribute specifies an initial [value for the button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#value).
|
|
39
|
+
*/
|
|
40
|
+
value?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Show loading progress inside button.
|
|
43
|
+
*/
|
|
44
|
+
state?: ButtonStateType;
|
|
45
|
+
/**
|
|
46
|
+
* Variant of the button. Use only 1 primary button on a page as CTA otherwise use one of the adaptive buttons.
|
|
47
|
+
*/
|
|
48
|
+
variant?: ButtonVariantType | string;
|
|
49
|
+
};
|
|
50
|
+
export type DBButtonProps = DBButtonDefaultProps & GlobalProps & ClickEventProps<HTMLButtonElement> & IconProps & WidthProps & SizeProps & ShowIconProps & TextProps;
|
|
51
|
+
export type DBButtonDefaultState = {};
|
|
52
|
+
export type DBButtonState = DBButtonDefaultState & GlobalState & ClickEventState<HTMLButtonElement>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBCard: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "spacing" | "onClick" | keyof import("../../shared/model").GlobalProps | keyof import("./model").DBCardDefaultProps> & import("./model").DBCardDefaultProps & import("../../shared/model").GlobalProps & import("../../shared/model").ClickEventProps<HTMLElement> & import("../../shared/model").SpacingProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export default DBCard;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useRef, forwardRef } from "react";
|
|
4
|
+
import { cls, filterPassingProps, getRootProps } from "../../utils";
|
|
5
|
+
function DBCardFn(props, component) {
|
|
6
|
+
const _ref = component || useRef(component);
|
|
7
|
+
function handleClick(event) {
|
|
8
|
+
if (props.onClick) {
|
|
9
|
+
props.onClick(event);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
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"]), { id: props.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-card", props.className), "data-behavior": props.behavior, "data-elevation-level": props.elevationLevel, "data-spacing": props.spacing, role: props.behavior === "interactive" ? "button" : undefined, tabIndex: props.behavior === "interactive" ? 0 : undefined, onClick: (event) => handleClick(event) }), props.children));
|
|
13
|
+
}
|
|
14
|
+
const DBCard = forwardRef(DBCardFn);
|
|
15
|
+
DBCard.defaultProps = {};
|
|
16
|
+
export default DBCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBCard } from './card';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBCard } from './card';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClickEventProps, ClickEventState, GlobalProps, GlobalState, SpacingProps } from '../../shared/model';
|
|
2
|
+
export declare const CardBehaviorList: readonly ["static", "interactive"];
|
|
3
|
+
export type CardBehaviorType = (typeof CardBehaviorList)[number];
|
|
4
|
+
export declare const CardElevationLevelList: readonly ["1", "2", "3"];
|
|
5
|
+
export type CardElevationLevelType = (typeof CardElevationLevelList)[number];
|
|
6
|
+
export type DBCardDefaultProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Makes the card interactive
|
|
9
|
+
*/
|
|
10
|
+
behavior?: CardBehaviorType;
|
|
11
|
+
/**
|
|
12
|
+
* Changes the elevation of the card which is equal to `basic-background-level`
|
|
13
|
+
*/
|
|
14
|
+
elevationLevel?: CardElevationLevelType;
|
|
15
|
+
};
|
|
16
|
+
export type DBCardProps = DBCardDefaultProps & GlobalProps & ClickEventProps<HTMLElement> & SpacingProps;
|
|
17
|
+
export type DBCardDefaultState = {};
|
|
18
|
+
export type DBCardState = DBCardDefaultState & GlobalState & ClickEventState<HTMLElement>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBCheckbox: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLInputElement>, "size" | "checked" | keyof import("../../shared/model").GlobalProps | "indeterminate" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").FormProps | keyof import("../../shared/model").FormMessageProps> & import("./model").DBCheckboxDefaultProps & import("../../shared/model").GlobalProps & import("../../shared/model").ChangeEventProps<HTMLInputElement> & import("../../shared/model").FocusEventProps<HTMLInputElement> & import("../../shared/model").FormProps & import("../../shared/model").FormCheckProps & import("../../shared/model").FormMessageProps & import("../../shared/model").SizeProps & React.RefAttributes<HTMLInputElement>>;
|
|
3
|
+
export default DBCheckbox;
|