@public-ui/sample-react 1.7.0-rc.5
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/.eslintignore +1 -0
- package/.eslintrc.js +27 -0
- package/.gitignore +41 -0
- package/.prettierignore +4 -0
- package/package.json +66 -0
- package/prettier.config.js +6 -0
- package/public/index.html +28 -0
- package/src/App.tsx +259 -0
- package/src/declare.d.ts +4 -0
- package/src/main.ts +7 -0
- package/src/react.main.tsx +56 -0
- package/src/routes-test.ts +79 -0
- package/src/samples/abbr/basic.html +6 -0
- package/src/samples/abbr/basic.tsx +39 -0
- package/src/samples/abbr/routes.ts +9 -0
- package/src/samples/accordion/basic.tsx +18 -0
- package/src/samples/accordion/header.tsx +17 -0
- package/src/samples/accordion/headlines.tsx +27 -0
- package/src/samples/accordion/list.tsx +32 -0
- package/src/samples/accordion/routes.ts +17 -0
- package/src/samples/alert/basic.tsx +37 -0
- package/src/samples/alert/card-msg.tsx +11 -0
- package/src/samples/alert/html.tsx +29 -0
- package/src/samples/alert/routes.ts +15 -0
- package/src/samples/avatar/basic.tsx +10 -0
- package/src/samples/avatar/routes.ts +8 -0
- package/src/samples/badge/basic.tsx +18 -0
- package/src/samples/badge/button.tsx +25 -0
- package/src/samples/badge/routes.ts +12 -0
- package/src/samples/breadcrumb/basic.tsx +53 -0
- package/src/samples/breadcrumb/routes.ts +9 -0
- package/src/samples/button/basic.tsx +29 -0
- package/src/samples/button/hide-label.tsx +31 -0
- package/src/samples/button/icons.tsx +27 -0
- package/src/samples/button/routes.ts +18 -0
- package/src/samples/button/width.tsx +30 -0
- package/src/samples/button-group/basic.tsx +13 -0
- package/src/samples/button-group/routes.ts +9 -0
- package/src/samples/button-link/basic.tsx +23 -0
- package/src/samples/button-link/icons.tsx +37 -0
- package/src/samples/button-link/image.tsx +14 -0
- package/src/samples/button-link/routes.ts +18 -0
- package/src/samples/button-link/target.tsx +16 -0
- package/src/samples/card/basic.tsx +12 -0
- package/src/samples/card/confirm.tsx +19 -0
- package/src/samples/card/flex.tsx +44 -0
- package/src/samples/card/routes.ts +18 -0
- package/src/samples/card/selection.tsx +70 -0
- package/src/samples/details/basic.tsx +19 -0
- package/src/samples/details/routes.ts +9 -0
- package/src/samples/form/routes.ts +5 -0
- package/src/samples/handout/basic.tsx +1013 -0
- package/src/samples/handout/routes.ts +9 -0
- package/src/samples/heading/badged.tsx +27 -0
- package/src/samples/heading/basic.tsx +15 -0
- package/src/samples/heading/paragraph.tsx +45 -0
- package/src/samples/heading/routes.ts +15 -0
- package/src/samples/icon/basic.tsx +17 -0
- package/src/samples/icon/routes.ts +9 -0
- package/src/samples/indented-text/basic.tsx +24 -0
- package/src/samples/indented-text/routes.ts +9 -0
- package/src/samples/input-checkbox/basic.tsx +37 -0
- package/src/samples/input-checkbox/routes.ts +9 -0
- package/src/samples/input-color/basic.tsx +29 -0
- package/src/samples/input-color/routes.ts +9 -0
- package/src/samples/input-date/basic.tsx +20 -0
- package/src/samples/input-date/routes.ts +9 -0
- package/src/samples/input-email/basic.tsx +30 -0
- package/src/samples/input-email/routes.ts +9 -0
- package/src/samples/input-file/basic.tsx +25 -0
- package/src/samples/input-file/routes.ts +9 -0
- package/src/samples/input-number/basic.tsx +30 -0
- package/src/samples/input-number/routes.ts +9 -0
- package/src/samples/input-password/basic.tsx +41 -0
- package/src/samples/input-password/routes.ts +9 -0
- package/src/samples/input-radio/basic.tsx +46 -0
- package/src/samples/input-radio/horizontal.tsx +42 -0
- package/src/samples/input-radio/routes.ts +14 -0
- package/src/samples/input-radio/select.tsx +18 -0
- package/src/samples/input-range/basic.tsx +29 -0
- package/src/samples/input-range/routes.ts +9 -0
- package/src/samples/input-text/basic.tsx +72 -0
- package/src/samples/input-text/blur.tsx +16 -0
- package/src/samples/input-text/focus.tsx +24 -0
- package/src/samples/input-text/hidden-label.tsx +66 -0
- package/src/samples/input-text/routes.ts +16 -0
- package/src/samples/link/basic.tsx +23 -0
- package/src/samples/link/icons.tsx +37 -0
- package/src/samples/link/image.tsx +20 -0
- package/src/samples/link/routes.ts +18 -0
- package/src/samples/link/target.tsx +15 -0
- package/src/samples/link-button/basic.tsx +22 -0
- package/src/samples/link-button/routes.ts +9 -0
- package/src/samples/link-group/routes.ts +5 -0
- package/src/samples/nav/active.tsx +88 -0
- package/src/samples/nav/aria-current.tsx +22 -0
- package/src/samples/nav/basic.tsx +62 -0
- package/src/samples/nav/horizontal.tsx +59 -0
- package/src/samples/nav/routes.ts +18 -0
- package/src/samples/pagination/basic.tsx +12 -0
- package/src/samples/pagination/routes.ts +9 -0
- package/src/samples/popover/basic.tsx +36 -0
- package/src/samples/popover/routes.ts +8 -0
- package/src/samples/progress/basic.tsx +11 -0
- package/src/samples/progress/routes.ts +9 -0
- package/src/samples/select/basic.tsx +51 -0
- package/src/samples/select/routes.ts +9 -0
- package/src/samples/skip-nav/basic.tsx +33 -0
- package/src/samples/skip-nav/routes.ts +9 -0
- package/src/samples/spin/basic.tsx +6 -0
- package/src/samples/spin/custom.css +52 -0
- package/src/samples/spin/custom.tsx +11 -0
- package/src/samples/spin/cycle.tsx +6 -0
- package/src/samples/spin/routes.ts +13 -0
- package/src/samples/split-button/basic.tsx +46 -0
- package/src/samples/split-button/routes.ts +8 -0
- package/src/samples/table/badge-size.tsx +51 -0
- package/src/samples/table/render-cell.tsx +48 -0
- package/src/samples/table/routes.ts +15 -0
- package/src/samples/table/sort-date.tsx +33 -0
- package/src/samples/table/test-data.ts +66 -0
- package/src/samples/textarea/adjust-height.tsx +22 -0
- package/src/samples/textarea/basic.tsx +11 -0
- package/src/samples/textarea/disabled.tsx +10 -0
- package/src/samples/textarea/placeholder.tsx +10 -0
- package/src/samples/textarea/readonly.tsx +10 -0
- package/src/samples/textarea/resize.tsx +13 -0
- package/src/samples/textarea/routes.ts +27 -0
- package/src/samples/textarea/rows.tsx +10 -0
- package/src/samples/toast/basic.tsx +21 -0
- package/src/samples/toast/routes.ts +8 -0
- package/src/samples/version/basic.tsx +6 -0
- package/src/samples/version/context.tsx +12 -0
- package/src/samples/version/routes.ts +12 -0
- package/src/shares/constants.ts +2 -0
- package/src/shares/react-roots.ts +10 -0
- package/src/shares/routes.ts +87 -0
- package/src/shares/store.ts +85 -0
- package/src/shares/theme.ts +103 -0
- package/src/shares/types.ts +4 -0
- package/src/style.scss +89 -0
- package/test-build.sh +2 -0
- package/tsconfig.json +32 -0
- package/unocss.config.ts +7 -0
- package/webpack.config.js +14 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolAccordion } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const AccordionHeadlines: FC = () => (
|
|
7
|
+
<div className="grid gap-4">
|
|
8
|
+
<KolAccordion _heading="Überschrift Level 1" _level={1}>
|
|
9
|
+
<div slot="content">Inhalt Accordion Tab 1</div>
|
|
10
|
+
</KolAccordion>
|
|
11
|
+
<KolAccordion _heading="Überschrift Level 2" _level={2}>
|
|
12
|
+
<div slot="content">Inhalt Accordion Tab 2</div>
|
|
13
|
+
</KolAccordion>
|
|
14
|
+
<KolAccordion _heading="Überschrift Level 3" _level={3}>
|
|
15
|
+
<div slot="content">Inhalt Accordion Tab 3</div>
|
|
16
|
+
</KolAccordion>
|
|
17
|
+
<KolAccordion _heading="Überschrift Level 4" _level={4}>
|
|
18
|
+
<div slot="content">Inhalt Accordion Tab 4</div>
|
|
19
|
+
</KolAccordion>
|
|
20
|
+
<KolAccordion _heading="Überschrift Level 5" _level={5}>
|
|
21
|
+
<div slot="content">Inhalt Accordion Tab 5</div>
|
|
22
|
+
</KolAccordion>
|
|
23
|
+
<KolAccordion _heading="Überschrift Level 6" _level={6}>
|
|
24
|
+
<div slot="content">Inhalt Accordion Tab 6</div>
|
|
25
|
+
</KolAccordion>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolAccordion, KolButton } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
const LIST = [
|
|
7
|
+
{
|
|
8
|
+
heading: 'Überschrift Accordion Tab 1',
|
|
9
|
+
content: 'Inhalt Accordion Tab 1',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
heading: 'Überschrift Accordion Tab 2',
|
|
13
|
+
content: 'Inhalt Accordion Tab 2',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
heading: 'Überschrift Accordion Tab 3',
|
|
17
|
+
content: 'Inhalt Accordion Tab 3',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export const AccordionList: FC = () => (
|
|
22
|
+
<div className="grid gap-4">
|
|
23
|
+
{LIST.map(({ heading, content }, index) => (
|
|
24
|
+
<KolAccordion _heading={heading} _level={1} _open={index === 1} key={index}>
|
|
25
|
+
<p slot="header">
|
|
26
|
+
<KolButton _label={'Bearbeiten'} />
|
|
27
|
+
</p>
|
|
28
|
+
<p slot="content">{content}</p>
|
|
29
|
+
</KolAccordion>
|
|
30
|
+
))}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Routes } from '../../shares/types';
|
|
2
|
+
|
|
3
|
+
import { AccordionBasic } from './basic';
|
|
4
|
+
|
|
5
|
+
import { AccordionHeader } from './header';
|
|
6
|
+
|
|
7
|
+
import { AccordionHeadlines } from './headlines';
|
|
8
|
+
import { AccordionList } from './list';
|
|
9
|
+
|
|
10
|
+
export const ACCORDION_ROUTES: Routes = {
|
|
11
|
+
accordion: {
|
|
12
|
+
basic: AccordionBasic,
|
|
13
|
+
header: AccordionHeader,
|
|
14
|
+
headlines: AccordionHeadlines,
|
|
15
|
+
list: AccordionList,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolAlert } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { HeadingLevel } from '@public-ui/components/dist/types/types/heading-level';
|
|
5
|
+
|
|
6
|
+
import { FC } from 'react';
|
|
7
|
+
import { AlertType, AlertVariant } from '@public-ui/components';
|
|
8
|
+
|
|
9
|
+
type PropsByType = {
|
|
10
|
+
level: HeadingLevel;
|
|
11
|
+
type: AlertType;
|
|
12
|
+
variant: AlertVariant;
|
|
13
|
+
};
|
|
14
|
+
type PropsBasic = {
|
|
15
|
+
variant: AlertVariant;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const AlertByType: FC<PropsByType> = ({ level, type, variant }) => (
|
|
19
|
+
<>
|
|
20
|
+
<KolAlert _heading="Das ist die Überschrift des Alert." _level={level} _type={type} _variant={variant}>
|
|
21
|
+
Das ist der Text des Alert.
|
|
22
|
+
</KolAlert>
|
|
23
|
+
<KolAlert _type={type} _variant={variant}>
|
|
24
|
+
In diesem Alert wird nur der Text ohne Überschrift verwendet.
|
|
25
|
+
</KolAlert>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const AlertBasic: FC<PropsBasic> = ({ variant }) => (
|
|
30
|
+
<div className="grid gap-4">
|
|
31
|
+
<AlertByType level={1} type="default" variant={variant} />
|
|
32
|
+
<AlertByType level={2} type="error" variant={variant} />
|
|
33
|
+
<AlertByType level={3} type="info" variant={variant} />
|
|
34
|
+
<AlertByType level={4} type="success" variant={variant} />
|
|
35
|
+
<AlertByType level={5} type="warning" variant={variant} />
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolAlert } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const AlertHtml: FC = () => (
|
|
7
|
+
<div>
|
|
8
|
+
<KolAlert _heading="Ausgabe von HTML-Code im Alert" _type="info">
|
|
9
|
+
{' '}
|
|
10
|
+
<h2 className="mt-2 mb-3">Hier wird eine H2-Überschrift ausgegeben</h2>
|
|
11
|
+
<div className="row">
|
|
12
|
+
<div className="col-12 col-sm-6">
|
|
13
|
+
<h4>Text in einer linken Spalte</h4>
|
|
14
|
+
<p>
|
|
15
|
+
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quidem sed fugiat dolorum ratione et, ullam officia nobis nihil debitis, consectetur dicta
|
|
16
|
+
accusantium. Vitae debitis, quibusdam vel recusandae deleniti placeat dolorem?
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
<div className="col-12 col-sm-6">
|
|
20
|
+
<h4>Text in einer rechten Spalte</h4>
|
|
21
|
+
<p>
|
|
22
|
+
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quod beatae officiis, velit nam dicta quae repellat perspiciatis explicabo illo. Possimus,
|
|
23
|
+
molestiae deleniti! Exercitationem blanditiis ducimus similique tempora ratione consequuntur eaque!
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</KolAlert>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Routes } from '../../shares/types';
|
|
2
|
+
|
|
3
|
+
import { AlertBasic } from './basic';
|
|
4
|
+
|
|
5
|
+
import { AlertCardMsg } from './card-msg';
|
|
6
|
+
|
|
7
|
+
import { AlertHtml } from './html';
|
|
8
|
+
|
|
9
|
+
export const ALERT_ROUTES: Routes = {
|
|
10
|
+
alert: {
|
|
11
|
+
basic: AlertBasic,
|
|
12
|
+
'card-msg': AlertCardMsg,
|
|
13
|
+
html: AlertHtml,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KolAvatar } from '@public-ui/react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
|
+
|
|
4
|
+
export const AvatarBasic: FC = () => (
|
|
5
|
+
<div className="flex flex-wrap gap-4">
|
|
6
|
+
<KolAvatar _src="https://www.w3schools.com/howto/img_avatar.png" _label="Elke Mustermann" />
|
|
7
|
+
<KolAvatar _label="Elke Mustermann" />
|
|
8
|
+
<KolAvatar _label="Marianne" />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolBadge } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
const PROPS = {
|
|
7
|
+
_label: 'Label',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const BadgeBasic: FC = () => (
|
|
11
|
+
<div className="d-flex gap-2">
|
|
12
|
+
<KolBadge {...PROPS}></KolBadge>
|
|
13
|
+
<KolBadge _color="#B22222" {...PROPS}></KolBadge>
|
|
14
|
+
<KolBadge _color="#4682B4" {...PROPS}></KolBadge>
|
|
15
|
+
<KolBadge _color="#228B22" {...PROPS}></KolBadge>
|
|
16
|
+
<KolBadge _color="#8B008B" {...PROPS}></KolBadge>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolBadge } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
const PROPS = {
|
|
7
|
+
_label: 'Label',
|
|
8
|
+
_smartButton: {
|
|
9
|
+
_icon: 'codicon codicon-close',
|
|
10
|
+
_label: 'Entfernen',
|
|
11
|
+
_on: {
|
|
12
|
+
onClick: () => alert('clicked'),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const BadgeButton: FC = () => (
|
|
18
|
+
<div className="d-flex gap-2">
|
|
19
|
+
<KolBadge {...PROPS}></KolBadge>
|
|
20
|
+
<KolBadge _color="#B22222" {...PROPS}></KolBadge>
|
|
21
|
+
<KolBadge _color="#4682B4" {...PROPS}></KolBadge>
|
|
22
|
+
<KolBadge _color="#228B22" {...PROPS}></KolBadge>
|
|
23
|
+
<KolBadge _color="#8B008B" {...PROPS}></KolBadge>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolBreadcrumb } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const BreadcrumbBasic: FC = () => (
|
|
7
|
+
<div className="grid gap-4">
|
|
8
|
+
<KolBreadcrumb
|
|
9
|
+
_ariaLabel="Breadcrumb aus Text-Links"
|
|
10
|
+
_links={[
|
|
11
|
+
{ _label: 'Startseite', _href: '#/' },
|
|
12
|
+
{ _label: 'Unterseite der Startseite', _href: '#/unterseite' },
|
|
13
|
+
{
|
|
14
|
+
_label: 'Unterseite der Unterseite',
|
|
15
|
+
_href: '#/unterseite/unterseite',
|
|
16
|
+
},
|
|
17
|
+
]}
|
|
18
|
+
></KolBreadcrumb>
|
|
19
|
+
<KolBreadcrumb
|
|
20
|
+
_ariaLabel="Breadcrumb aus Icons- oder Text-Links"
|
|
21
|
+
_links={[
|
|
22
|
+
{
|
|
23
|
+
_label: 'Startseite',
|
|
24
|
+
_icon: 'codicon codicon-home',
|
|
25
|
+
_hideLabel: true,
|
|
26
|
+
_href: '#/',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
_label: 'Unterseite der Startseite mit sehr langem Link-Test',
|
|
30
|
+
_href: '#/unterseite',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
_label: 'Unterseite der Unterseite',
|
|
34
|
+
_href: '#/unterseite/unterseite',
|
|
35
|
+
},
|
|
36
|
+
]}
|
|
37
|
+
></KolBreadcrumb>
|
|
38
|
+
<KolBreadcrumb
|
|
39
|
+
_ariaLabel="Breadcrumb aus Icons- und Text-Links"
|
|
40
|
+
_links={[
|
|
41
|
+
{ _label: 'Startseite', _icon: 'codicon codicon-home', _href: '#/' },
|
|
42
|
+
{
|
|
43
|
+
_label: 'Unterseite der Startseite und ich_bin_ein_echt_langes_zusammengesetztes_Worte_und_versuche_das_Layout_zu_brechen',
|
|
44
|
+
_href: '#/unterseite',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
_label: 'Unterseite der Unterseite',
|
|
48
|
+
_href: '#/unterseite/unterseite',
|
|
49
|
+
},
|
|
50
|
+
]}
|
|
51
|
+
></KolBreadcrumb>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButton } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
const ARGS = {
|
|
7
|
+
_on: {
|
|
8
|
+
onClick: (_event, _value) => alert('Klick!'),
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const ButtonBasic: FC = () => (
|
|
13
|
+
<div className="grid gap-14">
|
|
14
|
+
<div className="flex flex-wrap gap-14">
|
|
15
|
+
<KolButton _label="Primary" _variant="primary" {...ARGS}></KolButton>
|
|
16
|
+
<KolButton _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
|
|
17
|
+
<KolButton _label="Normal" _variant="normal" {...ARGS}></KolButton>
|
|
18
|
+
<KolButton _label="Danger" _variant="danger" {...ARGS}></KolButton>
|
|
19
|
+
<KolButton _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
|
|
20
|
+
</div>
|
|
21
|
+
<div className="flex flex-wrap gap-14">
|
|
22
|
+
<KolButton _disabled _label="Primary" _variant="primary"></KolButton>
|
|
23
|
+
<KolButton _disabled _label="Secondary" _variant="secondary"></KolButton>
|
|
24
|
+
<KolButton _disabled _label="Normal" _variant="normal"></KolButton>
|
|
25
|
+
<KolButton _disabled _label="Danger" _variant="danger"></KolButton>
|
|
26
|
+
<KolButton _disabled _label="Ghost" _variant="ghost"></KolButton>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButton } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
const ARGS = {
|
|
7
|
+
_icon: 'codicon codicon-home',
|
|
8
|
+
_hideLabel: true,
|
|
9
|
+
_on: {
|
|
10
|
+
onClick: (_event, _value) => alert('Klick!'),
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const ButtonIconOnly: FC = () => (
|
|
15
|
+
<div className="grid gap-14">
|
|
16
|
+
<div className="flex flex-wrap gap-14">
|
|
17
|
+
<KolButton _label="Primary" _variant="primary" _tooltipAlign="top" {...ARGS}></KolButton>
|
|
18
|
+
<KolButton _label="Secondary" _variant="secondary" _tooltipAlign="right" {...ARGS}></KolButton>
|
|
19
|
+
<KolButton _label="Normal" _variant="normal" _tooltipAlign="bottom" {...ARGS}></KolButton>
|
|
20
|
+
<KolButton _label="Danger" _variant="danger" _tooltipAlign="left" {...ARGS}></KolButton>
|
|
21
|
+
<KolButton _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
|
|
22
|
+
</div>
|
|
23
|
+
<div className="flex flex-wrap gap-14">
|
|
24
|
+
<KolButton _disabled _label="Primary" _variant="primary" {...ARGS}></KolButton>
|
|
25
|
+
<KolButton _disabled _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
|
|
26
|
+
<KolButton _disabled _label="Normal" _variant="normal" {...ARGS}></KolButton>
|
|
27
|
+
<KolButton _disabled _label="Danger" _variant="danger" {...ARGS}></KolButton>
|
|
28
|
+
<KolButton _disabled _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButton } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const ButtonIcons: FC = () => (
|
|
7
|
+
<KolButton
|
|
8
|
+
_icon={{
|
|
9
|
+
bottom: 'codicon codicon-arrow-down',
|
|
10
|
+
left: {
|
|
11
|
+
icon: 'codicon codicon-arrow-left',
|
|
12
|
+
},
|
|
13
|
+
top: {
|
|
14
|
+
style: {
|
|
15
|
+
'font-size': '200%',
|
|
16
|
+
transform: 'rotate(45deg)',
|
|
17
|
+
},
|
|
18
|
+
icon: 'codicon codicon-arrow-up',
|
|
19
|
+
},
|
|
20
|
+
right: 'codicon codicon-arrow-right',
|
|
21
|
+
}}
|
|
22
|
+
_label="Label"
|
|
23
|
+
_on={{
|
|
24
|
+
onClick: (_event, _value) => alert('Klick!'),
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Routes } from '../../shares/types';
|
|
2
|
+
|
|
3
|
+
import { ButtonBasic } from './basic';
|
|
4
|
+
|
|
5
|
+
import { ButtonIconOnly } from './hide-label';
|
|
6
|
+
|
|
7
|
+
import { ButtonIcons } from './icons';
|
|
8
|
+
|
|
9
|
+
import { ButtonWidth } from './width';
|
|
10
|
+
|
|
11
|
+
export const BUTTON_ROUTES: Routes = {
|
|
12
|
+
button: {
|
|
13
|
+
basic: ButtonBasic,
|
|
14
|
+
'hide-label': ButtonIconOnly,
|
|
15
|
+
icons: ButtonIcons,
|
|
16
|
+
width: ButtonWidth,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButton } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
const ARGS = {
|
|
7
|
+
className: 'w-8rem',
|
|
8
|
+
_on: {
|
|
9
|
+
onClick: (_event, _value) => alert('Klick!'),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const ButtonWidth: FC = () => (
|
|
14
|
+
<div className="grid gap-14">
|
|
15
|
+
<div className="flex flex-warp gap-14">
|
|
16
|
+
<KolButton _label="Primary" _variant="primary" {...ARGS}></KolButton>
|
|
17
|
+
<KolButton _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
|
|
18
|
+
<KolButton _label="Normal" _variant="normal" {...ARGS}></KolButton>
|
|
19
|
+
<KolButton _label="Danger" _variant="danger" {...ARGS}></KolButton>
|
|
20
|
+
<KolButton _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
|
|
21
|
+
</div>
|
|
22
|
+
<div className="flex flex-warp gap-14">
|
|
23
|
+
<KolButton _disabled _label="Primary" _variant="primary" {...ARGS}></KolButton>
|
|
24
|
+
<KolButton _disabled _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
|
|
25
|
+
<KolButton _disabled _label="Normal" _variant="normal" {...ARGS}></KolButton>
|
|
26
|
+
<KolButton _disabled _label="Danger" _variant="danger" {...ARGS}></KolButton>
|
|
27
|
+
<KolButton _disabled _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButton, KolButtonGroup } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const ButtonGroupBasic: FC = () => (
|
|
7
|
+
<KolButtonGroup>
|
|
8
|
+
<KolButton _label="Active" _variant="primary"></KolButton>
|
|
9
|
+
<KolButton _label="Not active" _disabled></KolButton>
|
|
10
|
+
<KolButton _label="Active" _icon="codicon codicon-home" _variant="danger"></KolButton>
|
|
11
|
+
<KolButton _label="Active" _icon="codicon codicon-trash" _hideLabel _variant="ghost"></KolButton>
|
|
12
|
+
</KolButtonGroup>
|
|
13
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButtonLink } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const ButtonLinkBasic: FC = () => (
|
|
7
|
+
<div className="grid gap-4">
|
|
8
|
+
<KolButtonLink _href="#" _label="Simple Link" />
|
|
9
|
+
<p>
|
|
10
|
+
In diesem Absatz wird ein Link gesetzt, der keine weiteren Attribute enthält. <KolButtonLink _href="#" _label="Simple Link" /> Er wird standardmäßig als{' '}
|
|
11
|
+
<strong>inline-Element</strong> ausgegeben.
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
In diesem Absatz wird ein Link gesetzt, der einmal als inline-block-Element ausgegeben wird.{' '}
|
|
15
|
+
<KolButtonLink class="d-inline-block" _href="#" _label="Simple Link" />. Damit kann man mir per CSS-Styles eine Breite, eine Höhe und andere Eigenschaften
|
|
16
|
+
zuweisen.
|
|
17
|
+
<br />
|
|
18
|
+
<br />
|
|
19
|
+
Danach folgt ein Link, der als block-Element ausgegeben wird.
|
|
20
|
+
<KolButtonLink class="d-block" _href="#" _label="Simple Link" />, daher gehe ich über die ganze Breite des Eltern-Elements erzeuge so einen Zeilenumbruch.
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButtonLink } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const ButtonLinkIcons: FC = () => (
|
|
7
|
+
<div className="grid gap-4">
|
|
8
|
+
<KolButtonLink _icon="codicon codicon-home" _label="Ich bin ein Link mit Icon links" />
|
|
9
|
+
<KolButtonLink
|
|
10
|
+
_icon={{
|
|
11
|
+
right: 'codicon codicon-home',
|
|
12
|
+
}}
|
|
13
|
+
_label="Ich bin ein Link mit Icon rechts"
|
|
14
|
+
/>
|
|
15
|
+
<KolButtonLink
|
|
16
|
+
_icon={{
|
|
17
|
+
top: 'codicon codicon-home',
|
|
18
|
+
}}
|
|
19
|
+
_label="Ich bin ein Link mit Icon oben"
|
|
20
|
+
/>
|
|
21
|
+
<KolButtonLink
|
|
22
|
+
_icon={{
|
|
23
|
+
bottom: 'codicon codicon-home',
|
|
24
|
+
}}
|
|
25
|
+
_label="Ich bin ein Link mit Icon unten"
|
|
26
|
+
/>
|
|
27
|
+
<KolButtonLink
|
|
28
|
+
_icon={{
|
|
29
|
+
top: 'codicon codicon-home',
|
|
30
|
+
right: 'codicon codicon-home',
|
|
31
|
+
bottom: 'codicon codicon-home',
|
|
32
|
+
left: 'codicon codicon-home',
|
|
33
|
+
}}
|
|
34
|
+
_label="Ich bin ein Link mit allen Icons"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButtonLink } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const ButtonLinkImage: FC = () => (
|
|
7
|
+
<div className="grid gap-4">
|
|
8
|
+
<KolButtonLink _href="#" _label="Ich bin ein Link, der als Text gerendert wird" />
|
|
9
|
+
<br />
|
|
10
|
+
<KolButtonLink _href="#" _label="">
|
|
11
|
+
<img alt="Abgrenzung" slot="expert" src="https://public-ui.github.io/assets/abgrenzung.jpg" width="300" />
|
|
12
|
+
</KolButtonLink>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Routes } from '../../shares/types';
|
|
2
|
+
|
|
3
|
+
import { ButtonLinkBasic } from './basic';
|
|
4
|
+
|
|
5
|
+
import { ButtonLinkIcons } from './icons';
|
|
6
|
+
|
|
7
|
+
import { ButtonLinkImage } from './image';
|
|
8
|
+
|
|
9
|
+
import { ButtonLinkTarget } from './target';
|
|
10
|
+
|
|
11
|
+
export const BUTTON_LINK_ROUTES: Routes = {
|
|
12
|
+
'button-link': {
|
|
13
|
+
basic: ButtonLinkBasic,
|
|
14
|
+
icons: ButtonLinkIcons,
|
|
15
|
+
image: ButtonLinkImage,
|
|
16
|
+
target: ButtonLinkTarget,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolAlert, KolButtonLink } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const ButtonLinkTarget: FC = () => (
|
|
7
|
+
<div className="grid gap-4">
|
|
8
|
+
<KolAlert _type="info">Bei einem semantischen Button der als Link dargestellt wird, gibt es kein Target!</KolAlert>
|
|
9
|
+
<KolButtonLink _href="#" _label="Ich bin ein Link ohne Target" />
|
|
10
|
+
<KolButtonLink _href="#" _label="Ich bin ein Link mit Target (_self)" _target="_self" />
|
|
11
|
+
<KolButtonLink _href="#" _label="Ich bin ein Link mit Target (_blank)" _target="_blank" />
|
|
12
|
+
<KolButtonLink _href="#" _icon="codicon codicon-home" _hideLabel _label="Ich bin ein Link ohne Target" />
|
|
13
|
+
<KolButtonLink _href="#" _icon="codicon codicon-home" _hideLabel _label="Ich bin ein Link mit Target (_self)" _target="_self" />
|
|
14
|
+
<KolButtonLink _href="#" _icon="codicon codicon-home" _hideLabel _label="Ich bin ein Link mit Target (_blank)" _target="_blank" />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolCard } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const CardBasic: FC = () => (
|
|
7
|
+
<KolCard _heading="Titel" _hasFooter>
|
|
8
|
+
<div slot="header">Zusätzlicher Header</div>
|
|
9
|
+
<div slot="content">Inhalt</div>
|
|
10
|
+
<div slot="footer">Fusszeile</div>
|
|
11
|
+
</KolCard>
|
|
12
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KolButton, KolCard } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
export const CardConfirm: FC = () => (
|
|
7
|
+
<KolCard _has-footer _heading="Überschrift">
|
|
8
|
+
<p className="p-2" slot="content">
|
|
9
|
+
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta pariatur laudantium saepe ipsa atque officia cupiditate repudiandae harum earum aut
|
|
10
|
+
doloribus autem libero exercitationem dolor ad, magni dignissimos ratione fuga. Lorem ipsum dolor sit amet consectetur adipisicing elit. Officiis
|
|
11
|
+
perferendis qui animi nesciunt illo facere, doloribus sint cupiditate nihil dolorem voluptate ab esse! Ducimus ad est commodi molestias voluptas
|
|
12
|
+
reiciendis.
|
|
13
|
+
</p>
|
|
14
|
+
<div slot="footer" className="d-flex gap-2 float-end">
|
|
15
|
+
<KolButton className="w-12rem" _variant="primary" _label="Speichern"></KolButton>
|
|
16
|
+
<KolButton className="w-12rem" _variant="secondary" _label="Abbrechen"></KolButton>
|
|
17
|
+
</div>
|
|
18
|
+
</KolCard>
|
|
19
|
+
);
|