@public-ui/sample-react 1.7.5 → 1.7.6-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1159.js +1 -1
- package/dist/1474.js +1 -1
- package/dist/183.js +1 -1
- package/dist/2337.js +1 -1
- package/dist/2412.js +1 -1
- package/dist/3303.js +1 -1
- package/dist/3325.js +1 -1
- package/dist/3429.js +1 -1
- package/dist/3459.js +1 -1
- package/dist/3537.js +1 -1
- package/dist/3932.js +1 -1
- package/dist/4021.js +1 -1
- package/dist/4022.js +1 -1
- package/dist/4195.js +1 -1
- package/dist/4291.js +1 -1
- package/dist/4323.js +1 -1
- package/dist/4355.js +1 -1
- package/dist/4477.js +1 -1
- package/dist/4564.js +1 -1
- package/dist/4891.js +1 -1
- package/dist/5183.js +1 -1
- package/dist/5369.js +1 -1
- package/dist/5390.js +1 -1
- package/dist/540.js +1 -1
- package/dist/5862.js +1 -1
- package/dist/5866.js +1 -1
- package/dist/{7200.js → 5991.js} +2 -2
- package/dist/6012.js +1 -1
- package/dist/6068.js +1 -1
- package/dist/6210.js +1 -1
- package/dist/6320.js +1 -1
- package/dist/6558.js +1 -1
- package/dist/6813.js +1 -1
- package/dist/6908.js +1 -1
- package/dist/7029.js +1 -1
- package/dist/7255.js +1 -1
- package/dist/7447.js +1 -1
- package/dist/7715.js +1 -1
- package/dist/7722.js +1 -1
- package/dist/7734.js +2 -0
- package/dist/7801.js +1 -1
- package/dist/7858.js +1 -1
- package/dist/7955.js +1 -1
- package/dist/7958.js +1 -1
- package/dist/7995.js +1 -1
- package/dist/8061.js +1 -1
- package/dist/8065.js +1 -1
- package/dist/8073.js +1 -1
- package/dist/8099.js +1 -1
- package/dist/8111.js +1 -1
- package/dist/8255.js +1 -1
- package/dist/8291.js +1 -1
- package/dist/{6691.js → 8314.js} +2 -2
- package/dist/{7495.js → 8598.js} +2 -2
- package/dist/8709.js +1 -1
- package/dist/8761.js +1 -1
- package/dist/9106.js +1 -1
- package/dist/{8068.js → 9456.js} +2 -2
- package/dist/9734.js +1 -1
- package/dist/9747.js +1 -1
- package/dist/9792.js +1 -1
- package/dist/9895.js +1 -1
- package/dist/9963.js +1 -1
- package/dist/9972.js +1 -1
- package/dist/main.css +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +14 -14
- package/src/components/FocusInput.tsx +9 -8
- package/src/components/badge/basic.tsx +5 -5
- package/src/components/toast/basic.tsx +58 -34
- package/src/shares/routes.ts +0 -2
- package/dist/6655.js +0 -2
- package/src/components/popover/basic.tsx +0 -36
- package/src/components/popover/routes.ts +0 -8
- /package/dist/{6655.js.LICENSE.txt → 5991.js.LICENSE.txt} +0 -0
- /package/dist/{6691.js.LICENSE.txt → 7734.js.LICENSE.txt} +0 -0
- /package/dist/{7200.js.LICENSE.txt → 8314.js.LICENSE.txt} +0 -0
- /package/dist/{7495.js.LICENSE.txt → 8598.js.LICENSE.txt} +0 -0
- /package/dist/{8068.js.LICENSE.txt → 9456.js.LICENSE.txt} +0 -0
package/dist/main.js.LICENSE.txt
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* @remix-run/router v1.
|
|
38
|
+
* @remix-run/router v1.11.0
|
|
39
39
|
*
|
|
40
40
|
* Copyright (c) Remix Software Inc.
|
|
41
41
|
*
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* React Router v6.
|
|
49
|
+
* React Router v6.18.0
|
|
50
50
|
*
|
|
51
51
|
* Copyright (c) Remix Software Inc.
|
|
52
52
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/sample-react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6-rc.1",
|
|
4
4
|
"description": "This app contains samples for the KoliBri/Public UI",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
6
|
"dependencies": {
|
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
"@leanup/stack-react": "1.3.48",
|
|
9
9
|
"@leanup/stack-webpack": "1.3.48",
|
|
10
10
|
"@public-oss/kolibri-themes": "0.0.3",
|
|
11
|
-
"@public-ui/components": "1.7.
|
|
12
|
-
"@public-ui/react": "1.7.
|
|
13
|
-
"@public-ui/themes": "1.7.
|
|
14
|
-
"@types/node": "20.
|
|
15
|
-
"@types/react": "18.2.
|
|
16
|
-
"@types/react-dom": "18.2.
|
|
17
|
-
"@unocss/preset-uno": "0.
|
|
18
|
-
"@unocss/webpack": "0.
|
|
11
|
+
"@public-ui/components": "1.7.6-rc.1",
|
|
12
|
+
"@public-ui/react": "1.7.6-rc.1",
|
|
13
|
+
"@public-ui/themes": "1.7.6-rc.1",
|
|
14
|
+
"@types/node": "20.9.0",
|
|
15
|
+
"@types/react": "18.2.37",
|
|
16
|
+
"@types/react-dom": "18.2.15",
|
|
17
|
+
"@unocss/preset-uno": "0.57.3",
|
|
18
|
+
"@unocss/webpack": "0.57.3",
|
|
19
19
|
"ajv": "8.12.0",
|
|
20
|
-
"chromedriver": "
|
|
20
|
+
"chromedriver": "119.0.1",
|
|
21
21
|
"cpy-cli": "5.0.0",
|
|
22
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
22
|
+
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
23
23
|
"eslint-plugin-react": "7.33.2",
|
|
24
24
|
"formik": "2.4.5",
|
|
25
25
|
"nightwatch-axe-verbose": "2.2.2",
|
|
26
26
|
"npm-run-all": "4.1.5",
|
|
27
27
|
"react": "18.2.0",
|
|
28
28
|
"react-dom": "18.2.0",
|
|
29
|
-
"react-router": "6.
|
|
30
|
-
"react-router-dom": "6.
|
|
29
|
+
"react-router": "6.18.0",
|
|
30
|
+
"react-router-dom": "6.18.0",
|
|
31
31
|
"rimraf": "3.0.2",
|
|
32
32
|
"ts-prune": "0.10.3",
|
|
33
33
|
"typescript": "5.2.2",
|
|
34
34
|
"world_countries_lists": "2.8.2",
|
|
35
|
-
"yup": "1.3.
|
|
35
|
+
"yup": "1.3.2"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
".eslintignore",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC,
|
|
1
|
+
import React, { FC, useRef } from 'react';
|
|
2
2
|
import { RefComponent } from './types';
|
|
3
3
|
|
|
4
4
|
type FokusElementProps = {
|
|
@@ -8,13 +8,14 @@ type FokusElementProps = {
|
|
|
8
8
|
export const FocusElement: FC<FokusElementProps> = (props) => {
|
|
9
9
|
const ref = useRef(null);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
11
|
+
/* Focus effect for the moment to ensure test stability */
|
|
12
|
+
// useLayoutEffect(() => {
|
|
13
|
+
// setTimeout(() => {
|
|
14
|
+
// if (ref.current && window.self === window.top) {
|
|
15
|
+
// (ref.current as unknown as HTMLElement).focus();
|
|
16
|
+
// }
|
|
17
|
+
// }, 500);
|
|
18
|
+
// }, [ref]);
|
|
18
19
|
|
|
19
20
|
return <props.RefComponent ref={ref} {...props} />;
|
|
20
21
|
};
|
|
@@ -8,11 +8,11 @@ const PROPS = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const BadgeBasic: FC = () => (
|
|
11
|
-
<div className="
|
|
11
|
+
<div className="flex gap-2">
|
|
12
12
|
<KolBadge {...PROPS}></KolBadge>
|
|
13
|
-
<KolBadge _color="#
|
|
14
|
-
<KolBadge _color="#
|
|
15
|
-
<KolBadge _color="#
|
|
16
|
-
<KolBadge _color="#
|
|
13
|
+
<KolBadge _color="#86ffc6" {...PROPS}></KolBadge>
|
|
14
|
+
<KolBadge _color="#06539e" {...PROPS}></KolBadge>
|
|
15
|
+
<KolBadge _color="#ae0000" {...PROPS}></KolBadge>
|
|
16
|
+
<KolBadge _color="#8b008b" {...PROPS}></KolBadge>
|
|
17
17
|
</div>
|
|
18
18
|
);
|
|
@@ -5,39 +5,63 @@ import { getRoot } from '../../shares/react-roots';
|
|
|
5
5
|
|
|
6
6
|
const toaster = ToasterService.getInstance(document);
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
8
|
+
export const ToastBasic: FC = () => {
|
|
9
|
+
const handleButtonClickSimple = () => {
|
|
10
|
+
void toaster.enqueue({
|
|
11
|
+
description: 'Toasty',
|
|
12
|
+
label: `Initial Toast`,
|
|
13
|
+
type: 'warning',
|
|
14
|
+
});
|
|
15
|
+
};
|
|
15
16
|
|
|
16
|
-
const handleButtonClickComplex = () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
17
|
+
const handleButtonClickComplex = () => {
|
|
18
|
+
void toaster.enqueue({
|
|
19
|
+
render: (element: HTMLElement, { close }) => {
|
|
20
|
+
getRoot(element).render(
|
|
21
|
+
<>
|
|
22
|
+
<KolButton
|
|
23
|
+
_label={'Hello World from Toast!'}
|
|
24
|
+
_on={{
|
|
25
|
+
onClick: () => {
|
|
26
|
+
console.log('Toast Button clicked!');
|
|
27
|
+
close();
|
|
28
|
+
},
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
</>,
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
label: `Initial Toast`,
|
|
35
|
+
type: 'warning',
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const handleButtonClickOpenAndClose = async () => {
|
|
40
|
+
const close = await toaster.enqueue({
|
|
41
|
+
description: 'I will disappear in two seconds...',
|
|
42
|
+
label: `Good Bye`,
|
|
43
|
+
type: 'warning',
|
|
44
|
+
});
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
)
|
|
46
|
+
if (close) {
|
|
47
|
+
setTimeout(close, 2000);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const closeAll = () => {
|
|
52
|
+
toaster.closeAll();
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div>
|
|
57
|
+
<KolButton _label="Show simple toast" _on={{ onClick: handleButtonClickSimple }}></KolButton>
|
|
58
|
+
<KolButton _label="Show complex toast" _on={{ onClick: handleButtonClickComplex }}></KolButton>
|
|
59
|
+
<br />
|
|
60
|
+
<br />
|
|
61
|
+
<KolButton _label="Show toast and close after 2 seconds" _on={{ onClick: () => void handleButtonClickOpenAndClose() }}></KolButton>
|
|
62
|
+
<br />
|
|
63
|
+
<br />
|
|
64
|
+
<KolButton _label="Close all toasts" _on={{ onClick: closeAll }}></KolButton>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
};
|
package/src/shares/routes.ts
CHANGED
|
@@ -33,7 +33,6 @@ import { LOGO_ROUTES } from '../components/logo/routes';
|
|
|
33
33
|
import { MODAL_ROUTES } from '../components/modal/routes';
|
|
34
34
|
import { NAV_ROUTES } from '../components/nav/routes';
|
|
35
35
|
import { PAGINATION_ROUTES } from '../components/pagination/routes';
|
|
36
|
-
import { POPOVER_ROUTES } from '../components/popover/routes';
|
|
37
36
|
import { PROGRESS_ROUTES } from '../components/progress/routes';
|
|
38
37
|
import { QUOTE_ROUTES } from '../components/quote/routes';
|
|
39
38
|
import { SELECT_ROUTES } from '../components/select/routes';
|
|
@@ -85,7 +84,6 @@ export const ROUTES: Routes = {
|
|
|
85
84
|
...MODAL_ROUTES,
|
|
86
85
|
...NAV_ROUTES,
|
|
87
86
|
...PAGINATION_ROUTES,
|
|
88
|
-
...POPOVER_ROUTES,
|
|
89
87
|
...PROGRESS_ROUTES,
|
|
90
88
|
...QUOTE_ROUTES,
|
|
91
89
|
...SELECT_ROUTES,
|
package/dist/6655.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 6655.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[6655],{6655:(t,e,i)=>{i.r(e),i.d(e,{kol_popover:()=>h});var o=i(8269),s=i(4604),n=i(9336),a=i(9430),r=i(1454),l=i(2180);const h=class{constructor(t){(0,o.r)(this,t),this.alignPopover=t=>{setTimeout((()=>{var e;if("test"!==l.p&&this.triggerElement&&this.popoverElement){const i=this.triggerElement,o=this.popoverElement,n=this.arrowElement,a=[(0,s.o)(null!==(e=null==n?void 0:n.offsetHeight)&&void 0!==e?e:10),(0,s.f)(),(0,s.s)()];n&&a.push((0,s.a)({element:n})),(0,s.c)(i,o,{placement:this.state._align,middleware:a}).then((({x:e,y:i,middlewareData:o,placement:s})=>{this.setPosition(e,i,o,s,t)}))}}))},this.showPopover=()=>{this.addListenersToBody(),this.alignPopover((()=>{this.state=Object.assign(Object.assign({},this.state),{_visible:!0})}))},this.hidePopoverByEscape=t=>{"Escape"===t.key&&this.hidePopover()},this.hidePopoverByClickOutside=t=>{this.host&&!this.host.contains(t.target)&&this.hidePopover()},this.catchHostAndTriggerElement=t=>{t&&(this.host=t,this.triggerElement=t.previousElementSibling)},this.catchPopoverElement=t=>{this.popoverElement=t},this.catchArrowElement=t=>{this.arrowElement=t},this._align="top",this._show=!1,this.state={_align:"top",_show:!1,_visible:!1}}setPosition(t,e,i,o,s){if(this.popoverElement){const n={left:this.popoverElement.style.left,top:this.popoverElement.style.top};if(Object.assign(this.popoverElement.style,{left:`${t}px`,top:`${e}px`}),this.arrowElement&&i.arrow)switch(o){case"top":this.arrowElement.style.inset=`100% auto auto ${i.arrow.x||0}px`,this.arrowElement.style.translate="0 -50%";break;case"right":this.arrowElement.style.inset=`${i.arrow.y||0}px 100% auto auto`,this.arrowElement.style.translate="50% 0";break;case"bottom":this.arrowElement.style.inset=`auto auto 100% ${i.arrow.x||0}px`,this.arrowElement.style.translate="0 50%";break;case"left":this.arrowElement.style.inset=`${i.arrow.y||0}px auto auto 100%`,this.arrowElement.style.translate="-50% 0"}n.left!==this.popoverElement.style.left||n.top!==this.popoverElement.style.top?this.alignPopover(s):"function"==typeof s&&s()}}hidePopover(){var t;this.state=Object.assign(Object.assign({},this.state),{_visible:!1}),this._show=!1,null===(t=this.triggerElement)||void 0===t||t.focus(),this.removeListenersToBody()}addListenersToBody(){var t;const e=(0,r.g)().body;e.addEventListener("keyup",this.hidePopoverByEscape),e.addEventListener("click",this.hidePopoverByClickOutside),null===(t=document.scrollingElement)||void 0===t||t.addEventListener("scroll",this.showPopover,{passive:!0})}removeListenersToBody(){var t;const e=(0,r.g)().body;e.removeEventListener("keyup",this.hidePopoverByEscape),e.removeEventListener("click",this.hidePopoverByClickOutside),null===(t=document.scrollingElement)||void 0===t||t.removeEventListener("scroll",this.showPopover)}render(){return(0,o.h)(o.H,{ref:this.catchHostAndTriggerElement},(0,o.h)("div",{class:{popover:!0,hidden:!this.state._show,show:this.state._visible},ref:this.catchPopoverElement},(0,o.h)("div",{class:`arrow ${this.state._align}`,ref:this.catchArrowElement}),(0,o.h)("slot",null)))}validateAlign(t){(0,n.v)(this,t)}validateShow(t){(0,a.v)(this,t),t&&this.showPopover()}componentWillLoad(){this.validateAlign(this._align),this.validateShow(this._show)}static get watchers(){return{_align:["validateAlign"],_show:["validateShow"]}}};h.style=":host{--a11y-min-size:44px;font-size:inherit}*{font-family:Verdana;hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}button,input,option,select,textarea{font-family:inherit}.icon-only>kol-span-wc>span>span{display:none}kol-popover{height:0;position:absolute}kol-popover .popover{background-color:#fff;min-height:max-content;min-width:max-content;opacity:0;position:absolute}kol-popover .hidden{display:none}kol-popover .show{animation:0.3s ease-in forwards fadeInOpacity}kol-popover .disappear{animation:0.3s ease-in backwards fadeInOpacity}kol-popover .arrow{background-color:inherit;height:var(--font-size);position:absolute;rotate:0.125turn;width:var(--font-size);z-index:-1}@keyframes fadeInOpacity{0%{opacity:0}100%{opacity:1}}"},9430:(t,e,i)=>{i.d(e,{v:()=>s});var o=i(8068);const s=(t,e,i)=>{(0,o.a)(t,"_show",e,i)}}}]);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { KolButton, KolInputPassword, KolInputText, KolPopover } from '@public-ui/react';
|
|
3
|
-
|
|
4
|
-
import { FC } from 'react';
|
|
5
|
-
|
|
6
|
-
export const PopoverBasic: FC = () => {
|
|
7
|
-
const [top, setTop] = React.useState(false);
|
|
8
|
-
const [right, setRight] = React.useState(false);
|
|
9
|
-
const [bottom, setBottom] = React.useState(false);
|
|
10
|
-
const [left, setLeft] = React.useState(false);
|
|
11
|
-
const [login, setLogin] = React.useState(false);
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div className="grid gap-4 max-w-[400px] mx-auto pt-8">
|
|
15
|
-
<KolButton _label="Oben" _icons="codicon codicon-arrow-up" _variant="primary" _on={{ onClick: () => setTop(!top) }}></KolButton>
|
|
16
|
-
<KolPopover _show={top}>Ich bin oberhalb</KolPopover>
|
|
17
|
-
<KolButton _label="Rechts" _icons="codicon codicon-arrow-right" _variant="danger" _on={{ onClick: () => setRight(!right) }}></KolButton>
|
|
18
|
-
<KolPopover _align="right" _show={right}>
|
|
19
|
-
Ich bin rechts
|
|
20
|
-
</KolPopover>
|
|
21
|
-
<KolButton _label="Unten" _icons="codicon codicon-arrow-down" _variant="secondary" _on={{ onClick: () => setBottom(!bottom) }}></KolButton>
|
|
22
|
-
<KolPopover _align="bottom" _show={bottom}>
|
|
23
|
-
Ich bin unterhalb
|
|
24
|
-
</KolPopover>
|
|
25
|
-
<KolButton _label="Links" _icons="codicon codicon-arrow-left" _variant="normal" _on={{ onClick: () => setLeft(!left) }}></KolButton>
|
|
26
|
-
<KolPopover _align="left" _show={left}>
|
|
27
|
-
Ich bin links
|
|
28
|
-
</KolPopover>
|
|
29
|
-
<KolButton _label="PR starten" _icons="codicon codicon-git-pull-request" _variant="normal" _on={{ onClick: () => setLogin(!login) }}></KolButton>
|
|
30
|
-
<KolPopover _show={login}>
|
|
31
|
-
<KolInputText>Benutzername</KolInputText>
|
|
32
|
-
<KolInputPassword>Passwort</KolInputPassword>
|
|
33
|
-
</KolPopover>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|