@public-ui/sample-react 2.0.6 → 2.0.8
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/104.js +1 -1
- package/dist/1296.js +1 -1
- package/dist/1461.js +1 -1
- package/dist/1684.js +1 -1
- package/dist/1685.js +1 -1
- package/dist/1888.js +1 -1
- package/dist/2120.js +1 -1
- package/dist/2240.js +1 -1
- package/dist/2364.js +1 -1
- package/dist/2392.js +1 -1
- package/dist/2444.js +1 -1
- package/dist/2628.js +1 -1
- package/dist/2740.js +1 -1
- package/dist/2764.js +1 -1
- package/dist/2782.js +1 -1
- package/dist/2812.js +1 -1
- package/dist/3200.js +1 -1
- package/dist/3204.js +1 -1
- package/dist/352.js +1 -1
- package/dist/3564.js +1 -1
- package/dist/3920.js +1 -1
- package/dist/4064.js +1 -1
- package/dist/4136.js +1 -1
- package/dist/4544.js +1 -1
- package/dist/4728.js +1 -1
- package/dist/4915.js +1 -1
- package/dist/4988.js +1 -1
- package/dist/5376.js +1 -1
- package/dist/5456.js +1 -1
- package/dist/5615.js +1 -1
- package/dist/5628.js +1 -1
- package/dist/5744.js +1 -1
- package/dist/5768.js +1 -1
- package/dist/5839.js +1 -1
- package/dist/5956.js +1 -1
- package/dist/5972.js +1 -1
- package/dist/6040.js +1 -1
- package/dist/7192.js +1 -1
- package/dist/72.js +2 -0
- package/dist/7312.js +1 -1
- package/dist/736.js +1 -1
- package/dist/7496.js +1 -1
- package/dist/7508.js +1 -1
- package/dist/7596.js +1 -1
- package/dist/7712.js +1 -1
- package/dist/7808.js +1 -1
- package/dist/8188.js +1 -1
- package/dist/8232.js +1 -1
- package/dist/8248.js +1 -1
- package/dist/828.js +1 -1
- package/dist/8476.js +1 -1
- package/dist/8524.js +1 -1
- package/dist/9072.js +1 -1
- package/dist/9088.js +1 -1
- package/dist/{6488.js → 9200.js} +2 -2
- package/dist/{1892.js → 9340.js} +2 -2
- package/dist/9404.js +1 -1
- package/dist/9424.js +1 -1
- package/dist/9680.js +1 -1
- package/dist/9888.js +1 -1
- package/dist/9984.js +1 -1
- package/dist/main.css +1 -1
- package/dist/main.js +19 -15
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +12 -13
- package/src/App.tsx +14 -16
- package/src/components/input-text/partials/cases.tsx +3 -4
- package/src/scenarios/disabled-interactive-elements.tsx +161 -0
- package/src/scenarios/routes.ts +2 -0
- package/src/scenarios/static-form.tsx +13 -2
- package/src/shares/theme.ts +3 -5
- package/dist/80.js +0 -2
- /package/dist/{1892.js.LICENSE.txt → 72.js.LICENSE.txt} +0 -0
- /package/dist/{6488.js.LICENSE.txt → 9200.js.LICENSE.txt} +0 -0
- /package/dist/{80.js.LICENSE.txt → 9340.js.LICENSE.txt} +0 -0
package/dist/main.js.LICENSE.txt
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* @remix-run/router v1.15.
|
|
36
|
+
* @remix-run/router v1.15.1
|
|
37
37
|
*
|
|
38
38
|
* Copyright (c) Remix Software Inc.
|
|
39
39
|
*
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* React Router v6.22.
|
|
47
|
+
* React Router v6.22.1
|
|
48
48
|
*
|
|
49
49
|
* Copyright (c) Remix Software Inc.
|
|
50
50
|
*
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/sample-react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "This app contains samples for the KoliBri/Public UI",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@leanup/stack": "1.3.49",
|
|
8
8
|
"@leanup/stack-react": "1.3.49",
|
|
9
9
|
"@leanup/stack-webpack": "1.3.49",
|
|
10
|
-
"@public-ui/components": "2.0.
|
|
11
|
-
"@public-ui/react": "2.0.
|
|
12
|
-
"@public-ui/themes": "2.0.
|
|
13
|
-
"@types/node": "20.11.
|
|
14
|
-
"@types/react": "18.2.
|
|
10
|
+
"@public-ui/components": "2.0.8",
|
|
11
|
+
"@public-ui/react": "2.0.8",
|
|
12
|
+
"@public-ui/themes": "2.0.8",
|
|
13
|
+
"@types/node": "20.11.19",
|
|
14
|
+
"@types/react": "18.2.57",
|
|
15
15
|
"@types/react-dom": "18.2.19",
|
|
16
16
|
"@unocss/preset-uno": "0.58.5",
|
|
17
17
|
"@unocss/webpack": "0.58.5",
|
|
18
18
|
"ajv": "8.12.0",
|
|
19
|
-
"chromedriver": "121.0.
|
|
19
|
+
"chromedriver": "121.0.2",
|
|
20
20
|
"cpy-cli": "5.0.0",
|
|
21
21
|
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
22
22
|
"eslint-plugin-react": "7.33.2",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"npm-run-all": "4.1.5",
|
|
26
26
|
"react": "18.2.0",
|
|
27
27
|
"react-dom": "18.2.0",
|
|
28
|
-
"react-router": "6.22.
|
|
29
|
-
"react-router-dom": "6.22.
|
|
28
|
+
"react-router": "6.22.1",
|
|
29
|
+
"react-router-dom": "6.22.1",
|
|
30
30
|
"rimraf": "3.0.2",
|
|
31
31
|
"ts-prune": "0.10.3",
|
|
32
32
|
"typescript": "5.3.3",
|
|
@@ -52,11 +52,10 @@
|
|
|
52
52
|
"build:deps": "pnpm --filter @public-ui/sample-react^... build",
|
|
53
53
|
"format": "prettier --check src",
|
|
54
54
|
"lint": "eslint \"{src,tests}/**/*.{html,js,json,jsx,ts,tsx,gql,graphql}\"",
|
|
55
|
+
"prepare:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" public/assets --dot",
|
|
56
|
+
"prepare:themes-assets": "cpy \"node_modules/@public-ui/themes/assets/**/*\" public/assets --dot",
|
|
55
57
|
"serve": "cross-env NODE_ENV=development webpack serve --devtool=source-map",
|
|
56
58
|
"start": "npm run serve -- --open",
|
|
57
|
-
"unused": "ts-prune -e src"
|
|
58
|
-
"postinstall": "npm-run-all postinstall:*",
|
|
59
|
-
"postinstall:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" public/assets --dot",
|
|
60
|
-
"postinstall:themes-assets": "cpy \"node_modules/@public-ui/themes/assets/**/*\" public/assets --dot"
|
|
59
|
+
"unused": "ts-prune -e src"
|
|
61
60
|
}
|
|
62
61
|
}
|
package/src/App.tsx
CHANGED
|
@@ -6,13 +6,13 @@ import { Navigate, Route, Routes, useSearchParams } from 'react-router-dom';
|
|
|
6
6
|
import PackageJson from '@public-ui/components/package.json';
|
|
7
7
|
import { KolAlert, KolBadge } from '@public-ui/react';
|
|
8
8
|
|
|
9
|
+
import { BackPage } from './components/BackPage';
|
|
9
10
|
import { Sidebar } from './components/Sidebar';
|
|
10
11
|
import { useSetCurrentLocation } from './hooks/useSetCurrentLocation';
|
|
11
12
|
import { HideMenusContext } from './shares/HideMenusContext';
|
|
12
13
|
import { ROUTES } from './shares/routes';
|
|
13
14
|
import { getTheme, getThemeName, setStorage, setTheme } from './shares/store';
|
|
14
|
-
import {
|
|
15
|
-
import { BackPage } from './components/BackPage';
|
|
15
|
+
import { THEMES, THEME_OPTIONS, isDraftTheme } from './shares/theme';
|
|
16
16
|
|
|
17
17
|
import type { Route as MyRoute, Routes as MyRoutes } from './shares/types';
|
|
18
18
|
|
|
@@ -50,19 +50,17 @@ const getRouteTree = (routes: MyRoutes): ReturnType<typeof Route>[] => {
|
|
|
50
50
|
path={`${path}/all`}
|
|
51
51
|
element={
|
|
52
52
|
<div className="d-grid gap-4">
|
|
53
|
-
{THEME_OPTIONS.filter((theme) =>
|
|
54
|
-
(theme)
|
|
55
|
-
<div className="
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
<ThisRoute />
|
|
61
|
-
</div>
|
|
62
|
-
<hr aria-hidden="true" />
|
|
53
|
+
{THEME_OPTIONS.filter((theme) => THEMES.indexOf((theme as Option<Theme>).value) >= 0).map((theme) => (
|
|
54
|
+
<div className="d-grid gap-2" key={(theme as Option<Theme>).value} data-theme={(theme as Option<Theme>).value}>
|
|
55
|
+
<div className="mt-4">
|
|
56
|
+
<strong>{theme.label}</strong>
|
|
57
|
+
</div>
|
|
58
|
+
<div className="my-2">
|
|
59
|
+
<ThisRoute />
|
|
63
60
|
</div>
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
<hr aria-hidden="true" />
|
|
62
|
+
</div>
|
|
63
|
+
))}
|
|
66
64
|
</div>
|
|
67
65
|
}
|
|
68
66
|
/>,
|
|
@@ -137,14 +135,14 @@ export const App: FC = () => {
|
|
|
137
135
|
/>
|
|
138
136
|
)}
|
|
139
137
|
|
|
140
|
-
<
|
|
138
|
+
<main className="p-4" id="route-container">
|
|
141
139
|
{!hideMenus && isDraftTheme(theme) && <KolBadge className="block mb-3" _label="DRAFT" _color="#db5461" />}
|
|
142
140
|
<Routes>
|
|
143
141
|
{ROUTE_TREE}
|
|
144
142
|
<Route path="*" element={<KolAlert _type="info">This code example has not been migrated yet - it's coming soon!</KolAlert>} />
|
|
145
143
|
<Route path="back-page" element={<BackPage />} />
|
|
146
144
|
</Routes>
|
|
147
|
-
</
|
|
145
|
+
</main>
|
|
148
146
|
</div>
|
|
149
147
|
</HideMenusContext.Provider>
|
|
150
148
|
);
|
|
@@ -14,7 +14,6 @@ export const InputTextCases = forwardRef<HTMLKolInputTextElement, Components.Kol
|
|
|
14
14
|
_error={ERROR_MSG}
|
|
15
15
|
_placeholder="Mit Icons"
|
|
16
16
|
_icons={{
|
|
17
|
-
left: 'codicon codicon-arrow-left',
|
|
18
17
|
right: {
|
|
19
18
|
icon: 'codicon codicon-arrow-right',
|
|
20
19
|
style: {
|
|
@@ -28,13 +27,13 @@ export const InputTextCases = forwardRef<HTMLKolInputTextElement, Components.Kol
|
|
|
28
27
|
onClick: console.log,
|
|
29
28
|
onFocus: console.log,
|
|
30
29
|
}}
|
|
31
|
-
_hideLabel
|
|
32
30
|
_required
|
|
33
31
|
_type="search"
|
|
34
32
|
_touched
|
|
35
|
-
_label="
|
|
33
|
+
_label="Vorname (text)"
|
|
34
|
+
_accessKey="V"
|
|
35
|
+
ref={ref}
|
|
36
36
|
/>
|
|
37
|
-
<KolInputText {...props} ref={ref} _accessKey="V" _placeholder="Placeholder" _label="Vorname (text)" _required />
|
|
38
37
|
<KolInputText {...props} _placeholder="Placeholder" _label="Suche (search)" _type="search" />
|
|
39
38
|
<KolInputText {...props} _placeholder="Placeholder" _error={ERROR_MSG} _touched _type="url" _label="URL (url)" />
|
|
40
39
|
<KolInputText {...props} _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" />
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KolAccordion,
|
|
3
|
+
KolButton,
|
|
4
|
+
KolButtonLink,
|
|
5
|
+
KolCard,
|
|
6
|
+
KolDetails,
|
|
7
|
+
KolInputCheckbox,
|
|
8
|
+
KolInputColor,
|
|
9
|
+
KolInputDate,
|
|
10
|
+
KolInputEmail,
|
|
11
|
+
KolInputFile,
|
|
12
|
+
KolInputNumber,
|
|
13
|
+
KolInputPassword,
|
|
14
|
+
KolInputRadio,
|
|
15
|
+
KolInputRange,
|
|
16
|
+
KolInputText,
|
|
17
|
+
KolLink,
|
|
18
|
+
KolLinkButton,
|
|
19
|
+
KolSelect,
|
|
20
|
+
KolTextarea,
|
|
21
|
+
} from '@public-ui/react';
|
|
22
|
+
import type { FC } from 'react';
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { SampleDescription } from '../components/SampleDescription';
|
|
25
|
+
|
|
26
|
+
const OPTIONS = [
|
|
27
|
+
{
|
|
28
|
+
label: 'Option A',
|
|
29
|
+
value: 'A',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Option B',
|
|
33
|
+
value: 'B',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export const DisabledInteractiveElements: FC = () => (
|
|
38
|
+
<>
|
|
39
|
+
<SampleDescription>
|
|
40
|
+
<p>This example shows how deactivated interactive elements are displayed.</p>
|
|
41
|
+
<ul>
|
|
42
|
+
<li>Deactivated interactive elements pose a particular challenge for accessibility.</li>
|
|
43
|
+
<li>It must not be possible to focus on deactivated interactive elements, otherwise the tab paths will be unnecessarily extended.</li>
|
|
44
|
+
<li>Deactivated interactive elements should be labelled clearly and legibly.</li>
|
|
45
|
+
<li>
|
|
46
|
+
Deactivated interactive elements have a tooltip for sighted people and aria labelling for the screen readers reading mode if they are represented by
|
|
47
|
+
an interpretable graphic.
|
|
48
|
+
</li>
|
|
49
|
+
</ul>
|
|
50
|
+
<p>This implementation ensures standardized use for all users.</p>
|
|
51
|
+
</SampleDescription>
|
|
52
|
+
<div className="grid gap-4">
|
|
53
|
+
<KolCard _label="Button" _level={0}>
|
|
54
|
+
<div className="flex flex-wrap gap-4">
|
|
55
|
+
<KolButton _label="Label" />
|
|
56
|
+
<KolButton _disabled _label="Label" />
|
|
57
|
+
<KolButton _hideLabel _icons="codicon codicon-home" _label="Label" />
|
|
58
|
+
<KolButton _disabled _hideLabel _icons="codicon codicon-home" _label="Label" />
|
|
59
|
+
</div>
|
|
60
|
+
</KolCard>
|
|
61
|
+
<KolCard _label="ButtonLink" _level={0}>
|
|
62
|
+
<div className="flex flex-wrap gap-4">
|
|
63
|
+
<KolButtonLink _label="Label" />
|
|
64
|
+
<KolButtonLink _disabled _label="Label" />
|
|
65
|
+
<KolButtonLink _hideLabel _icons="codicon codicon-home" _label="Label" />
|
|
66
|
+
<KolButtonLink _hideLabel _icons="codicon codicon-home" _disabled _label="Label" />
|
|
67
|
+
</div>
|
|
68
|
+
</KolCard>
|
|
69
|
+
<KolCard _label="Link" _level={0}>
|
|
70
|
+
<div className="flex flex-wrap gap-4">
|
|
71
|
+
<KolLink _href="#" _label="Label" />
|
|
72
|
+
<KolLink _disabled _href="#" _label="Label" />
|
|
73
|
+
<KolLink _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
|
|
74
|
+
<KolLink _disabled _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
|
|
75
|
+
</div>
|
|
76
|
+
</KolCard>
|
|
77
|
+
<KolCard _label="LinkButton" _level={0}>
|
|
78
|
+
<div className="flex flex-wrap gap-4">
|
|
79
|
+
<KolLinkButton _href="#" _label="Label" />
|
|
80
|
+
<KolLinkButton _disabled _href="#" _label="Label" />
|
|
81
|
+
<KolLinkButton _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
|
|
82
|
+
<KolLinkButton _disabled _hideLabel _href="#" _icons="codicon codicon-home" _label="Label" />
|
|
83
|
+
</div>
|
|
84
|
+
</KolCard>
|
|
85
|
+
<KolCard _label="Accordion" _level={0}>
|
|
86
|
+
<div className="grid gap-4">
|
|
87
|
+
<KolAccordion _label="Label">Content</KolAccordion>
|
|
88
|
+
<KolAccordion _disabled _label="Label">
|
|
89
|
+
Content
|
|
90
|
+
</KolAccordion>
|
|
91
|
+
<KolAccordion _label="Label (open)" _open>
|
|
92
|
+
Content
|
|
93
|
+
</KolAccordion>
|
|
94
|
+
<KolAccordion _disabled _label="Label (open)" _open>
|
|
95
|
+
Content
|
|
96
|
+
</KolAccordion>
|
|
97
|
+
</div>
|
|
98
|
+
</KolCard>
|
|
99
|
+
<KolCard _label="Details" _level={0}>
|
|
100
|
+
<div className="grid gap-4">
|
|
101
|
+
<KolDetails _label="Label">Content</KolDetails>
|
|
102
|
+
<KolDetails _disabled _label="Label">
|
|
103
|
+
Content
|
|
104
|
+
</KolDetails>
|
|
105
|
+
<KolDetails _label="Label (open)" _open>
|
|
106
|
+
Content
|
|
107
|
+
</KolDetails>
|
|
108
|
+
<KolDetails _disabled _label="Label (open)" _open>
|
|
109
|
+
Content
|
|
110
|
+
</KolDetails>
|
|
111
|
+
</div>
|
|
112
|
+
</KolCard>
|
|
113
|
+
{[KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRange, KolInputText].map(
|
|
114
|
+
(Input) => {
|
|
115
|
+
const render = (
|
|
116
|
+
Input as typeof KolInputCheckbox & {
|
|
117
|
+
render: { displayName: string };
|
|
118
|
+
}
|
|
119
|
+
).render;
|
|
120
|
+
const name = render.displayName;
|
|
121
|
+
return (
|
|
122
|
+
<KolCard key={name} _label={name} _level={0}>
|
|
123
|
+
<div className="grid gap-4">
|
|
124
|
+
<Input _label="Label" />
|
|
125
|
+
<Input _disabled _label="Label" />
|
|
126
|
+
<Input _hideLabel _label="Label" />
|
|
127
|
+
<Input _disabled _hideLabel _label="Label" />
|
|
128
|
+
</div>
|
|
129
|
+
</KolCard>
|
|
130
|
+
);
|
|
131
|
+
},
|
|
132
|
+
)}
|
|
133
|
+
{[KolInputRadio, KolSelect].map((Input) => {
|
|
134
|
+
const render = (
|
|
135
|
+
Input as typeof KolInputRadio & {
|
|
136
|
+
render: { displayName: string };
|
|
137
|
+
}
|
|
138
|
+
).render;
|
|
139
|
+
const name = render.displayName;
|
|
140
|
+
return (
|
|
141
|
+
<KolCard key={name} _label={name} _level={0}>
|
|
142
|
+
<div className="grid gap-4">
|
|
143
|
+
<Input _label="Label" _options={OPTIONS} />
|
|
144
|
+
<Input _disabled _label="Label" _options={OPTIONS} />
|
|
145
|
+
<Input _hideLabel _label="Label" _options={OPTIONS} />
|
|
146
|
+
<Input _disabled _hideLabel _label="Label" _options={OPTIONS} />
|
|
147
|
+
</div>
|
|
148
|
+
</KolCard>
|
|
149
|
+
);
|
|
150
|
+
})}
|
|
151
|
+
<KolCard _label="KolTextarea" _level={0}>
|
|
152
|
+
<div className="grid gap-4">
|
|
153
|
+
<KolTextarea _label="Label" _rows={3} />
|
|
154
|
+
<KolTextarea _disabled _label="Label" _rows={3} />
|
|
155
|
+
<KolTextarea _hideLabel _label="Label" _rows={3} />
|
|
156
|
+
<KolTextarea _disabled _hideLabel _label="Label" _rows={3} />
|
|
157
|
+
</div>
|
|
158
|
+
</KolCard>
|
|
159
|
+
</div>
|
|
160
|
+
</>
|
|
161
|
+
);
|
package/src/scenarios/routes.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Routes } from '../shares/types';
|
|
|
2
2
|
import { AppointmentForm } from './appointment-form/AppointmentForm';
|
|
3
3
|
import { TerminComponent } from './complex-form/component';
|
|
4
4
|
import { CustomTooltipWidth } from './custom-tooltip-width';
|
|
5
|
+
import { DisabledInteractiveElements } from './disabled-interactive-elements';
|
|
5
6
|
import { InputsGetValue } from './inputs-get-value';
|
|
6
7
|
import { StaticForm } from './static-form';
|
|
7
8
|
|
|
@@ -12,5 +13,6 @@ export const SCENARIO_ROUTES: Routes = {
|
|
|
12
13
|
'inputs-get-value': InputsGetValue,
|
|
13
14
|
'custom-tooltip-width': CustomTooltipWidth,
|
|
14
15
|
'static-form': StaticForm,
|
|
16
|
+
'disabled-interactive-scenario': DisabledInteractiveElements,
|
|
15
17
|
},
|
|
16
18
|
};
|
|
@@ -41,12 +41,13 @@ export const StaticForm: FC = () => {
|
|
|
41
41
|
</li>
|
|
42
42
|
</ol>
|
|
43
43
|
</SampleDescription>
|
|
44
|
-
<form className="grid gap-4" method="get">
|
|
44
|
+
<form className="grid gap-4" method="get" noValidate>
|
|
45
45
|
<KolInputCheckbox _name="checkbox" _label="Checkbox" />
|
|
46
46
|
<KolInputColor _name="color" _label="Color" />
|
|
47
47
|
<KolInputDate _name="date" _label="Date" />
|
|
48
48
|
<KolInputEmail _name="email" _label="Email" />
|
|
49
49
|
<KolInputFile _name="file" _label="File" />
|
|
50
|
+
<KolInputFile _name="file" _label="Files (multiple)" _multiple />
|
|
50
51
|
<KolInputNumber _name="number" _label="Number" />
|
|
51
52
|
<KolInputPassword _name="password" _label="Password" />
|
|
52
53
|
<KolInputRadio
|
|
@@ -67,7 +68,17 @@ export const StaticForm: FC = () => {
|
|
|
67
68
|
{ label: 'Option B', value: 'B' },
|
|
68
69
|
]}
|
|
69
70
|
/>
|
|
70
|
-
<
|
|
71
|
+
<KolSelect
|
|
72
|
+
_name="select"
|
|
73
|
+
_label="Select (multiple)"
|
|
74
|
+
_multiple
|
|
75
|
+
_options={[
|
|
76
|
+
{ label: 'Option A', value: 'A' },
|
|
77
|
+
{ label: 'Option B', value: 'B' },
|
|
78
|
+
]}
|
|
79
|
+
_rows={2}
|
|
80
|
+
/>
|
|
81
|
+
<KolTextarea _name="textarea" _label="Textarea" _rows={5} />
|
|
71
82
|
<div className="flex flex-wrap gap-4">
|
|
72
83
|
<KolButton _label="Submit" _type="submit" _variant="primary" />
|
|
73
84
|
<KolButton _label="Reset" _type="reset" />
|
package/src/shares/theme.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { SelectOption } from '@public-ui/components';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export const THEMES = ['bmf', 'default', 'ecl-ec', 'ecl-eu', 'itzbund'] as const;
|
|
4
|
+
export type Theme = (typeof THEMES)[number] | 'unstyled';
|
|
4
5
|
|
|
5
6
|
const drafts: Theme[] = ['ecl-ec', 'ecl-eu', 'itzbund'];
|
|
6
7
|
|
|
7
8
|
export const isDraftTheme = (theme: Theme) => drafts.includes(theme);
|
|
8
9
|
|
|
9
10
|
export const isTheme = (value: unknown) => {
|
|
10
|
-
return (
|
|
11
|
-
typeof value === 'string' &&
|
|
12
|
-
(value === 'bmf' || value === 'default' || value === 'ecl-ec' || value === 'ecl-eu' || value === 'itzbund' || value === 'unstyled')
|
|
13
|
-
);
|
|
11
|
+
return THEMES.find((theme) => theme === value) !== undefined;
|
|
14
12
|
};
|
|
15
13
|
|
|
16
14
|
export type Store = {
|
package/dist/80.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 80.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[80],{7620:(t,e,o)=>{o.d(e,{I:()=>i});var n=o(3520);const i=({accessKey:t,label:e})=>{let[o,...i]=e.split(t);return 0===i.length&&(t=t.toUpperCase(),[o,...i]=e.split(t)),0===i.length&&(t=t.toLowerCase(),[o,...i]=e.split(t)),(0,n.h)(n.F,null,o,i.length?(0,n.h)(n.F,null,(0,n.h)("u",null,t),i.join(t)):null)}},7184:(t,e,o)=>{o.d(e,{A:()=>i});var n=o(5244);class i{constructor(t,e,o){var i,s;if(this.experimentalMode=(0,n.a0)(),this.setFormAssociatedValue=t=>{var e;const o=null===(e=this.formAssociated)||void 0===e?void 0:e.getAttribute("name");null!==o&&""!==o||(0,n.h)(` The form field (${this.name}) must have a name attribute to be form-associated. Please define the _name attribute.`);const i=this.tryToStringifyValue(t);this.syncValue(t,i,this.formAssociated),this.syncValue(t,i,this.syncToOwnInput)},this.component=t,this.host=this.findHostWithShadowRoot(o),this.name=e,this.experimentalMode){switch(null===(i=this.host)||void 0===i||i.querySelectorAll("input,select,textarea").forEach((t=>{var e;null===(e=this.host)||void 0===e||e.removeChild(t)})),this.name){case"button":this.formAssociated=document.createElement("button");break;case"select":this.formAssociated=document.createElement("select"),this.formAssociated.setAttribute("multiple","");break;case"textarea":this.formAssociated=document.createElement("textarea");break;default:this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type","hidden")}this.formAssociated.setAttribute("aria-hidden","true"),this.formAssociated.setAttribute("data-form-associated",""),this.formAssociated.setAttribute("hidden",""),null===(s=this.host)||void 0===s||s.appendChild(this.formAssociated)}}findHostWithShadowRoot(t){for(;null===(null==t?void 0:t.shadowRoot)&&t!==document.body;)(t=null==t?void 0:t.parentNode).host&&(t=t.host);return t}setAttribute(t,e,o){if(this.experimentalMode)try{if("boolean"!=typeof(o="object"==typeof o&&null!==o?JSON.stringify(o):o)&&"number"!=typeof o&&"string"!=typeof o)throw new Error("Invalid value type: "+typeof o);null==e||e.setAttribute(t,`${o}`)}catch(o){null==e||e.removeAttribute(t)}}tryToStringifyValue(t){try{return"object"==typeof t&&null!==t?JSON.stringify(t).toString():null==t?null:t.toString()}catch(t){return(0,n.a1)(`The form field raw value is not able to stringify! ${t}`),""}}syncValue(t,e,o){o&&("select"===this.name?(o.querySelectorAll("option").forEach((t=>{o.removeChild(t)})),Array.isArray(t)&&t.forEach((t=>{const e=this.tryToStringifyValue(t);if("string"==typeof e){const t=document.createElement("option");t.setAttribute("value",e),t.setAttribute("selected",""),o.appendChild(t)}}))):"string"==typeof e?(o.setAttribute("value",e),o.value=e):(o.removeAttribute("value"),o.value=""))}validateName(t){(0,n.a2)(this.component,t,{hooks:{afterPatch:()=>{this.setAttribute("name",this.formAssociated,this.component.state._name)}}}),void 0===t&&(0,n.h)("Ein Name am Eingabefeldern oder Schalter ist nicht zwingend erforderlich, kann aber für die Autocomplete-Funktion und für das statische Versenden des Eingabefeldes relevant sein.")}validateSyncValueBySelector(t){if(this.experimentalMode&&"string"==typeof t){const e=document.querySelector(t);e&&(this.syncToOwnInput=e)}}componentWillLoad(){this.validateName(this.component._name),this.validateSyncValueBySelector(this.component._syncValueBySelector)}}},9972:(t,e,o)=>{o.d(e,{I:()=>s});var n=o(5244),i=o(4572);class s extends i.I{constructor(t,e,o){super(t,e,o),this.component=t}validateAutoComplete(t){(0,n.w)(this.component,"_autoComplete",(t=>"string"==typeof t&&("on"===t||"off"===t)),new Set(["on | off"]),t)}validateHasCounter(t){(0,n.ac)(this.component,t)}validateMaxLength(t){(0,n.a7)(this.component,"_maxLength",t,{min:0})}validatePattern(t){(0,n.C)(this.component,"_pattern",t)}validatePlaceholder(t){(0,n.C)(this.component,"_placeholder",t)}validateReadOnly(t){(0,n.B)(this.component,"_readOnly",t)}validateRequired(t){(0,n.B)(this.component,"_required",t)}validateValue(t){(0,n.C)(this.component,"_value",t),this.setFormAssociatedValue(this.component.state._value)}componentWillLoad(){super.componentWillLoad(),this.validateAutoComplete(this.component._autoComplete),this.validateHasCounter(this.component._hasCounter),this.validateMaxLength(this.component._maxLength),this.validatePattern(this.component._pattern),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateValue(this.component._value)}onBlur(t){this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:this.placeholderCache}),this.placeholderCache=void 0,super.onBlur(t)}onFocus(t){this.placeholderCache=this.component.state._placeholder,this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:void 0}),super.onFocus(t)}}},9728:(t,e,o)=>{o.d(e,{I:()=>r,g:()=>a});var n=o(5244),i=o(3344),s=o(7184);const a=t=>{const e="string"==typeof t._error&&t._error.length>0&&!0===t._touched,o="string"==typeof t._hint&&t._hint.length>0,n=[];return!0===e&&n.push(`${t._id}-error`),!0===o&&n.push(`${t._id}-hint`),{hasError:e,hasHint:o,ariaDescribedBy:n}};class l extends s.A{constructor(t,e,o){super(t,e,o),this.component=t}validateAlert(t){(0,n.B)(this.component,"_alert",t)}validateTouched(t){(0,n.N)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class r extends l{constructor(t,e,o){super(t,e,o),this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this)},this.component=t}validateAccessKey(t){(0,n.C)(this.component,"_accessKey",t)}validateAdjustHeight(t){(0,n.O)(this.component,t)}validateDisabled(t){(0,n.B)(this.component,"_disabled",t),!0===t&&(0,n.P)()}validateError(t){(0,n.C)(this.component,"_error",t)}validateHideError(t){(0,n.Q)(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideError&&(0,n.T)("Property hide-error for inputs: Only use when the error message is shown outside of the input component.")}}})}validateHideLabel(t){(0,n.R)(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideLabel&&(0,n.T)("Property hide-label for inputs: Only use for exceptions like search inputs that are clearly identifiable by their context.")}}})}validateHint(t){(0,n.C)(this.component,"_hint",t)}validateId(t){(0,n.C)(this.component,"_id",t,{hooks:{afterPatch:()=>{this.setAttribute("id",this.formAssociated,this.component.state._id)}},minLength:1}),""!==t&&void 0!==t||(0,n.h)("Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.")}validateLabel(t){(0,n.U)(this.component,t,{required:!0})}validateOn(t){"object"==typeof t&&(0,n.m)(this.component,"_on",t)}validateSmartButton(t){(0,n.t)(t,(()=>{try{t=(0,n.u)(t)}catch(t){}(0,n.m)(this.component,"_smartButton",t)}))}validateTabIndex(t){(0,n.V)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateDisabled(this.component._disabled),this.validateHideError(this.component._hideError),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateLabel(this.component._label),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex)}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,(0,i.s)(t),(0,i.t)("blur",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t){var e;const o=t.target.value;(0,i.t)("change",this.host,o),this.setFormAssociatedValue(o),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onChange)&&this.component._on.onChange(t,o),this.valueChangeListeners.forEach((t=>t(o)))}onClick(t){var e;(0,i.s)(t),(0,i.t)("click",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,(0,i.s)(t),(0,i.t)("focus",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}},7088:(t,e,o)=>{o.d(e,{I:()=>s,a:()=>a});var n=o(5244),i=o(9972);class s extends i.I{constructor(t,e,o){super(t,e,o),this.component=t}validateSuggestions(t){(0,n.a4)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateSuggestions(this.component._suggestions)}}class a extends s{constructor(t,e,o){super(t,e,o),this.hasError=!1,this.component=t}validateType(t){(0,n.w)(this.component,"_type",(t=>"string"==typeof t&&n.ab.includes(t)),new Set([`String {${n.ab.join(", ")}`]),t)}validateHasCounter(t){(0,n.ac)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateType(this.component._type),this.validateHasCounter(this.component._hasCounter)}}},5488:(t,e,o)=>{o.d(e,{a:()=>s,p:()=>a});var n=o(5244);const i=t=>{for((0,n.a0)()&&((0,n.h)("↓ Search form element start."),console.log(t));t instanceof HTMLElement&&"FORM"!==t.tagName&&"KOL-FORM"!==t.tagName;){try{t=t.parentElement instanceof HTMLElement?t.parentElement:t.parentNode instanceof ShadowRoot?t.parentNode.host:null}catch(t){}(0,n.a0)()&&(console.log(t),(0,n.h)("↑ Search form element finished."))}return t},s=(t={})=>{var e,o;const s=i(t.form);if(s instanceof HTMLElement){const t=new Event("reset",{bubbles:!0,cancelable:!0});if("FORM"===s.tagName)(0,n.a9)(t,s),s.dispatchEvent(t);else if("KOL-FORM"===s.tagName){(0,n.a9)(t,n.K.querySelector("form",s));const i=s;"function"==typeof(null===(e=i._on)||void 0===e?void 0:e.onReset)&&(null===(o=i._on)||void 0===o||o.onReset(t))}}},a=(t={})=>{var e,o;const s=i(t.form);if(s instanceof HTMLElement){const t=new SubmitEvent("submit",{bubbles:!0,cancelable:!0,submitter:s});if("FORM"===s.tagName)(0,n.a9)(t,s),s.dispatchEvent(t),s.submit();else if("KOL-FORM"===s.tagName){(0,n.a9)(t,n.K.querySelector("form",s));const i=s;"function"==typeof(null===(e=i._on)||void 0===e?void 0:e.onSubmit)&&(null===(o=i._on)||void 0===o||o.onSubmit(t))}}}},4572:(t,e,o)=>{o.d(e,{I:()=>a});var n=o(5244),i=o(9728);const s=(t,e)=>{const o=t;"object"==typeof o&&null!==o&&((0,n.H)(o.right,1)&&(o.right={icon:o.right}),(0,n.H)(o.left,1)&&(o.left={icon:o.left}),e.set("_icons",o))};class a extends i.I{constructor(t,e,o){super(t,e,o),this.component=t}validateIcon(t){this.validateIcons(t)}validateIcons(t){(0,n.t)(t,(()=>{try{t=(0,n.u)(t)}catch(t){}(0,n.w)(this.component,"_icons",(t=>"object"==typeof t&&null!==t&&((0,n.H)(t.left,1)||(0,n.a5)(t.left)||(0,n.H)(t.right,1)||(0,n.a5)(t.right))),new Set(["KoliBriHorizontalIcon"]),t,{hooks:{beforePatch:s},required:!0})}))}componentWillLoad(){super.componentWillLoad(),this.validateIcons(this.component._icons||this.component._icon)}}},3344:(t,e,o)=>{function n(t){t.stopImmediatePropagation(),t.stopPropagation()}function i(t,e,o){e&&function(t,e,o){const n=t.dispatchEvent(function(t,e){return new CustomEvent(`kol-${t}`,{bubbles:!0,cancelable:!0,composed:!0,detail:e})}(e,o))}(e,t,o)}function s(t){t.preventDefault(),n(t)}o.d(e,{p:()=>s,s:()=>n,t:()=>i})}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|