@public-ui/sample-react 4.3.1-rc.0 → 4.3.1-rc.4
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/package.json +10 -10
- package/src/App.tsx +2 -0
- package/src/components/InputEventValueDemo.tsx +6 -3
- package/src/components/SampleBlock.tsx +81 -0
- package/src/components/SampleGroup.tsx +27 -0
- package/src/components/abbr/basic.tsx +6 -3
- package/src/components/accordion/basic.tsx +3 -2
- package/src/components/accordion/headlines.tsx +3 -2
- package/src/components/alert/basic.tsx +17 -14
- package/src/components/avatar/basic.tsx +3 -2
- package/src/components/avatar/size.tsx +3 -2
- package/src/components/badge/basic.tsx +48 -7
- package/src/components/badge/routes.ts +0 -4
- package/src/components/breadcrumb/basic.tsx +3 -2
- package/src/components/button/access-key.tsx +8 -10
- package/src/components/button/aria-description.tsx +4 -4
- package/src/components/button/baselined.tsx +4 -4
- package/src/components/button/basic.tsx +10 -17
- package/src/components/button/disabled.tsx +6 -7
- package/src/components/button/expert-slot.tsx +6 -7
- package/src/components/button/focus-options.tsx +8 -10
- package/src/components/button/hide-label.tsx +8 -10
- package/src/components/button/icons.tsx +12 -16
- package/src/components/button/row-reverse-tooltip.tsx +4 -4
- package/src/components/button/short-key.tsx +15 -20
- package/src/components/button/spinner.tsx +6 -7
- package/src/components/button/variants.tsx +6 -6
- package/src/components/button/width.tsx +6 -7
- package/src/components/button-link/aria-description.tsx +3 -2
- package/src/components/button-link/basic.tsx +37 -35
- package/src/components/button-link/icons.tsx +13 -2
- package/src/components/button-link/image.tsx +3 -2
- package/src/components/card/basic.tsx +3 -2
- package/src/components/card/headlines.tsx +3 -2
- package/src/components/card/linked.tsx +3 -2
- package/src/components/combobox/partials/cases.tsx +40 -14
- package/src/components/combobox/partials/variants.tsx +7 -8
- package/src/components/details/basic.tsx +3 -2
- package/src/components/form/basic.tsx +5 -4
- package/src/components/form/error-list-scroll.tsx +87 -0
- package/src/components/form/error-list.tsx +56 -56
- package/src/components/form/routes.ts +2 -0
- package/src/components/heading/badged.tsx +3 -2
- package/src/components/heading/basic.tsx +3 -2
- package/src/components/heading/paragraph.tsx +3 -2
- package/src/components/heading/secondary.tsx +3 -2
- package/src/components/icon/all-kolicons.tsx +1 -1
- package/src/components/icon/basic.tsx +6 -6
- package/src/components/icon/font.tsx +21 -13
- package/src/components/image/basic.tsx +8 -5
- package/src/components/input-checkbox/partials/cases.tsx +75 -14
- package/src/components/input-checkbox/partials/variants.tsx +13 -16
- package/src/components/input-color/partials/cases.tsx +61 -18
- package/src/components/input-color/partials/variants.tsx +7 -8
- package/src/components/input-date/partials/cases.tsx +70 -26
- package/src/components/input-date/partials/minMax.tsx +38 -11
- package/src/components/input-date/partials/variants.tsx +10 -12
- package/src/components/input-email/partials/cases.tsx +69 -30
- package/src/components/input-email/partials/variants.tsx +7 -8
- package/src/components/input-file/partials/cases.tsx +58 -24
- package/src/components/input-file/partials/variants.tsx +7 -8
- package/src/components/input-number/number-formatter.tsx +5 -4
- package/src/components/input-number/partials/cases.tsx +68 -28
- package/src/components/input-number/partials/variants.tsx +7 -8
- package/src/components/input-password/partials/cases.tsx +67 -30
- package/src/components/input-password/partials/variants.tsx +7 -8
- package/src/components/input-password/show-password.tsx +22 -19
- package/src/components/input-radio/horizontal.tsx +3 -2
- package/src/components/input-radio/objectValue.tsx +5 -4
- package/src/components/input-radio/partials/cases.tsx +85 -55
- package/src/components/input-radio/partials/variants.tsx +7 -9
- package/src/components/input-range/partials/cases.tsx +60 -23
- package/src/components/input-range/partials/variants.tsx +7 -8
- package/src/components/input-text/access-short-key.tsx +11 -4
- package/src/components/input-text/aria-details.tsx +3 -2
- package/src/components/input-text/background-test.tsx +7 -5
- package/src/components/input-text/basic.tsx +24 -5
- package/src/components/input-text/clear-button.tsx +26 -0
- package/src/components/input-text/counter.tsx +3 -2
- package/src/components/input-text/disabled.tsx +11 -4
- package/src/components/input-text/expert-slot.tsx +13 -8
- package/src/components/input-text/hide-label.tsx +7 -6
- package/src/components/input-text/hide-msg.tsx +5 -4
- package/src/components/input-text/message-types.tsx +13 -4
- package/src/components/input-text/msg-and-counter.tsx +9 -4
- package/src/components/input-text/pattern.tsx +18 -15
- package/src/components/input-text/placeholder.tsx +13 -4
- package/src/components/input-text/readonly.tsx +11 -4
- package/src/components/input-text/routes.ts +2 -0
- package/src/components/input-text/select-range.tsx +3 -2
- package/src/components/input-text/smart-button.tsx +7 -4
- package/src/components/input-text/text-formatter.tsx +5 -4
- package/src/components/input-text/variant.tsx +8 -6
- package/src/components/kolibri/basic.tsx +9 -6
- package/src/components/link/basic.tsx +3 -2
- package/src/components/link/icons.tsx +3 -2
- package/src/components/link/image.tsx +3 -2
- package/src/components/link/target.tsx +3 -2
- package/src/components/link/variant.tsx +5 -4
- package/src/components/link-button/aria-description.tsx +7 -1
- package/src/components/link-button/basic.tsx +5 -4
- package/src/components/link-button/routes.ts +2 -0
- package/src/components/link-button/target.tsx +19 -0
- package/src/components/meter/basic.tsx +4 -4
- package/src/components/meter/dynamic.tsx +4 -4
- package/src/components/meter/optimum.tsx +8 -10
- package/src/components/meter/orientation.tsx +6 -7
- package/src/components/nav/aria-current.tsx +18 -15
- package/src/components/nav/basic.tsx +8 -10
- package/src/components/pagination/basic.tsx +3 -2
- package/src/components/pagination/button-visibility.tsx +16 -11
- package/src/components/pagination/sibling-boundary.tsx +3 -2
- package/src/components/popover-button/inline.tsx +4 -5
- package/src/components/progress/basic.tsx +7 -6
- package/src/components/quote/basic.tsx +4 -1
- package/src/components/quote/block.tsx +9 -6
- package/src/components/select/partials/cases.tsx +73 -33
- package/src/components/select/partials/variants.tsx +7 -8
- package/src/components/single-select/partials/cases.tsx +148 -114
- package/src/components/single-select/partials/variants.tsx +7 -8
- package/src/components/spin/basic.tsx +34 -3
- package/src/components/spin/routes.ts +0 -8
- package/src/components/split-button/basic.tsx +3 -2
- package/src/components/table/action-columns.tsx +3 -2
- package/src/components/table/column-alignment.tsx +3 -2
- package/src/components/table/complex-headers.tsx +3 -2
- package/src/components/table/empty.tsx +31 -0
- package/src/components/table/horizontal-scrollbar.tsx +24 -19
- package/src/components/table/multi-sort.tsx +6 -7
- package/src/components/table/non-hidable-columns.tsx +18 -15
- package/src/components/table/pagination-position.tsx +8 -10
- package/src/components/table/routes.ts +4 -0
- package/src/components/table/sort-data.tsx +6 -7
- package/src/components/table/stateful-async.tsx +50 -0
- package/src/components/table/stateful-with-selection.tsx +3 -2
- package/src/components/table/stateful-with-single-selection.tsx +3 -2
- package/src/components/table/stateless-async-paging.tsx +9 -32
- package/src/components/table/stateless-with-selection.tsx +3 -2
- package/src/components/table/stateless-with-single-selection.tsx +3 -2
- package/src/components/table/stateless.tsx +3 -2
- package/src/components/table/sticky-col.tsx +12 -10
- package/src/components/table/sticky-header.tsx +12 -10
- package/src/components/table/variant.tsx +5 -4
- package/src/components/table/with-footer.tsx +73 -70
- package/src/components/table/with-pagination.tsx +3 -2
- package/src/components/tabs/basic.tsx +17 -12
- package/src/components/tabs/create-button.tsx +11 -8
- package/src/components/tabs/icons-only.tsx +9 -6
- package/src/components/textarea/adjust-height.tsx +6 -3
- package/src/components/textarea/partials/cases.tsx +63 -15
- package/src/components/textarea/partials/variants.tsx +7 -8
- package/src/components/textarea/resize.tsx +3 -2
- package/src/components/textarea/rows.tsx +6 -3
- package/src/components/textarea/with-counter.tsx +3 -2
- package/src/components/toolbar/basic.tsx +6 -5
- package/src/components/toolbar/disabled.tsx +41 -38
- package/src/components/tree/basic.tsx +32 -29
- package/src/components/version/basic.tsx +4 -1
- package/src/components/version/context.tsx +8 -5
- package/src/hooks/useVisualBlockOutline.ts +38 -0
- package/src/scenarios/button-shortkey-table.tsx +4 -4
- package/src/scenarios/routes.ts +2 -0
- package/src/scenarios/same-height-of-all-form-elements-with-label.tsx +46 -0
- package/src/shares/store.ts +0 -4
- package/src/shares/visualBlockOutline.ts +75 -0
- package/src/components/badge/button.tsx +0 -35
- package/src/components/badge/formatted-label.tsx +0 -19
- package/src/components/spin/custom.tsx +0 -23
- package/src/components/spin/cycle.tsx +0 -16
- package/src/components/spin/label.tsx +0 -23
- package/src/components/spin/variables.tsx +0 -16
|
@@ -2,15 +2,19 @@ import { KolInputText } from '@public-ui/react-v19';
|
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { logKoliBriCallbackEvent, logKoliBriNativeEvent } from '../../shares/utils';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const InputTextBasic: FC = () => (
|
|
8
|
-
|
|
9
|
+
<div className="grid gap-4">
|
|
9
10
|
<SampleDescription>
|
|
10
|
-
<p>
|
|
11
|
+
<p>
|
|
12
|
+
This story showcases the most important InputText variants: default, required, validation error, disabled, read-only, search with clear button, and with
|
|
13
|
+
icons.
|
|
14
|
+
</p>
|
|
11
15
|
</SampleDescription>
|
|
12
16
|
|
|
13
|
-
<
|
|
17
|
+
<SampleBlock id="events">
|
|
14
18
|
<KolInputText
|
|
15
19
|
_label="Name"
|
|
16
20
|
_value="Anderson-Clark"
|
|
@@ -29,22 +33,37 @@ export const InputTextBasic: FC = () => (
|
|
|
29
33
|
onInput={logKoliBriNativeEvent}
|
|
30
34
|
onKeyDown={logKoliBriNativeEvent}
|
|
31
35
|
/>
|
|
36
|
+
</SampleBlock>
|
|
37
|
+
<SampleBlock id="error">
|
|
32
38
|
<KolInputText _label="Name" _required _msg={{ _type: 'error', _description: 'Please enter your name' }} _touched />
|
|
39
|
+
</SampleBlock>
|
|
40
|
+
<SampleBlock id="hint">
|
|
33
41
|
<KolInputText _label="Name" _required _hint="Enter your surname" />
|
|
42
|
+
</SampleBlock>
|
|
43
|
+
<SampleBlock id="disabled">
|
|
34
44
|
<KolInputText _label="Name" _value="Anderson-Clark" _disabled />
|
|
45
|
+
</SampleBlock>
|
|
46
|
+
<SampleBlock id="info-popover">
|
|
35
47
|
<KolInputText
|
|
36
48
|
_label="Name"
|
|
37
49
|
_required
|
|
38
50
|
_value="Anderson-Clark"
|
|
39
51
|
_infoPopover={{ _label: 'hint', _content: 'Ich bin ein Hinweis.', _icons: 'kolicon-alert-info' }}
|
|
40
52
|
/>
|
|
53
|
+
</SampleBlock>
|
|
54
|
+
<SampleBlock id="readonly-popover">
|
|
41
55
|
<KolInputText
|
|
42
56
|
_label="Name"
|
|
43
57
|
_readOnly
|
|
44
58
|
_value="Anderson-Clark"
|
|
45
59
|
_infoPopover={{ _label: 'hint', _content: 'Ich bin ein Hinweis.', _icons: 'kolicon-alert-info' }}
|
|
46
60
|
/>
|
|
61
|
+
</SampleBlock>
|
|
62
|
+
<SampleBlock id="icon">
|
|
47
63
|
<KolInputText _label="Name" _icons="kolicon-house" _value="Anderson-Clark" />
|
|
48
|
-
</
|
|
49
|
-
|
|
64
|
+
</SampleBlock>
|
|
65
|
+
<SampleBlock id="search">
|
|
66
|
+
<KolInputText _label="Search" _type="search" _value="test" _placeholder="Search with clear button" />
|
|
67
|
+
</SampleBlock>
|
|
68
|
+
</div>
|
|
50
69
|
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { KolInputText } from '@public-ui/react-v19';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
|
+
|
|
7
|
+
export const InputTextClearButton: FC = () => (
|
|
8
|
+
<div className="grid gap-4">
|
|
9
|
+
<SampleDescription>
|
|
10
|
+
<p>This sample demonstrates the clear button for search type input fields.</p>
|
|
11
|
+
</SampleDescription>
|
|
12
|
+
|
|
13
|
+
<SampleBlock id="search-empty">
|
|
14
|
+
<KolInputText _label="Search" _type="search" _placeholder="Enter search term" />
|
|
15
|
+
</SampleBlock>
|
|
16
|
+
<SampleBlock id="search-value">
|
|
17
|
+
<KolInputText _label="Search (with value)" _type="search" _value="test" _placeholder="Enter search term" />
|
|
18
|
+
</SampleBlock>
|
|
19
|
+
<SampleBlock id="search-disabled">
|
|
20
|
+
<KolInputText _label="Search (disabled)" _type="search" _disabled _value="test" _placeholder="Disabled search" />
|
|
21
|
+
</SampleBlock>
|
|
22
|
+
<SampleBlock id="text-no-clear-button">
|
|
23
|
+
<KolInputText _label="Text (no clear button)" _type="text" _value="test" _placeholder="Regular text input" />
|
|
24
|
+
</SampleBlock>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextCounter: FC = () => (
|
|
@@ -9,8 +10,8 @@ export const InputTextCounter: FC = () => (
|
|
|
9
10
|
<p>This story showcases an input with a counter for the chars in the field. Maximal length is 30.</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="counter">
|
|
13
14
|
<KolInputText _label="Name" _icons="kolicon-house" _value="Anderson-Clark" _hasCounter _maxLength={30} />
|
|
14
|
-
</
|
|
15
|
+
</SampleBlock>
|
|
15
16
|
</>
|
|
16
17
|
);
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import { KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextDisabled: FC = () => (
|
|
7
|
-
|
|
8
|
+
<div className="grid gap-4">
|
|
8
9
|
<SampleDescription>
|
|
9
10
|
<p>This story demonstrates the disabled state of KolInputText. Disabled inputs cannot be edited or focused.</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="placeholder">
|
|
13
14
|
<KolInputText _label="Disabled with placeholder" _placeholder="Placeholder text" _disabled />
|
|
15
|
+
</SampleBlock>
|
|
16
|
+
<SampleBlock id="value">
|
|
14
17
|
<KolInputText _label="Disabled with value" _value="This field is disabled" _disabled />
|
|
18
|
+
</SampleBlock>
|
|
19
|
+
<SampleBlock id="error">
|
|
15
20
|
<KolInputText _label="Disabled with error message" _value="Invalid value" _msg={{ _type: 'error', _description: 'Error message' }} _disabled _touched />
|
|
21
|
+
</SampleBlock>
|
|
22
|
+
<SampleBlock id="enabled">
|
|
16
23
|
<KolInputText _label="Comparison: Enabled" _value="This field is enabled" />
|
|
17
|
-
</
|
|
18
|
-
|
|
24
|
+
</SampleBlock>
|
|
25
|
+
</div>
|
|
19
26
|
);
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { KolBadge, KolIcon, KolInputText, KolPopoverButton } from '@public-ui/react-v19';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { SampleBlock } from '../SampleBlock';
|
|
3
4
|
import { SampleDescription } from '../SampleDescription';
|
|
4
5
|
|
|
5
6
|
export const InputTextExpertSlot = () => {
|
|
6
7
|
return (
|
|
7
|
-
|
|
8
|
+
<div className="grid gap-4">
|
|
8
9
|
<SampleDescription>
|
|
9
10
|
<p>This sample shows KolInputText with expert slot. The expert slot allows for complex custom content beyond simple text inputs.</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="text">
|
|
13
14
|
<KolInputText _label="" _type="text">
|
|
14
15
|
<span slot="expert">I am more than just a input field</span>
|
|
15
16
|
</KolInputText>
|
|
16
|
-
|
|
17
|
+
</SampleBlock>
|
|
18
|
+
<SampleBlock id="badge">
|
|
17
19
|
<KolInputText _label="" _type="text" _value="Complex example">
|
|
18
20
|
<div slot="expert" className="flex items-center gap-2">
|
|
19
21
|
<KolBadge _label="Premium" _color="#1a73e8" />
|
|
@@ -21,13 +23,15 @@ export const InputTextExpertSlot = () => {
|
|
|
21
23
|
<span>Verified account with premium features</span>
|
|
22
24
|
</div>
|
|
23
25
|
</KolInputText>
|
|
24
|
-
|
|
26
|
+
</SampleBlock>
|
|
27
|
+
<SampleBlock id="note">
|
|
25
28
|
<KolInputText _label="" _type="text" _placeholder="Enter your email">
|
|
26
29
|
<div slot="expert" style={{ padding: '0.5rem', backgroundColor: '#f0f0f0', borderRadius: '4px' }}>
|
|
27
30
|
<strong>Note:</strong> This email will be used for account recovery and notifications.
|
|
28
31
|
</div>
|
|
29
32
|
</KolInputText>
|
|
30
|
-
|
|
33
|
+
</SampleBlock>
|
|
34
|
+
<SampleBlock id="required">
|
|
31
35
|
<KolInputText _label="" _type="text" _required>
|
|
32
36
|
<div slot="expert" className="inline-block">
|
|
33
37
|
<span className="expert-slot-required-label">Username</span>
|
|
@@ -36,7 +40,8 @@ export const InputTextExpertSlot = () => {
|
|
|
36
40
|
</KolPopoverButton>
|
|
37
41
|
</div>
|
|
38
42
|
</KolInputText>
|
|
39
|
-
|
|
43
|
+
</SampleBlock>
|
|
44
|
+
<SampleBlock id="readonly">
|
|
40
45
|
<KolInputText _label="" _type="text" _readOnly _value="(read only) is also not appended">
|
|
41
46
|
<div slot="expert" className="inline-block">
|
|
42
47
|
<span className="expert-slot-required-label">Username</span>
|
|
@@ -45,7 +50,7 @@ export const InputTextExpertSlot = () => {
|
|
|
45
50
|
</KolPopoverButton>
|
|
46
51
|
</div>
|
|
47
52
|
</KolInputText>
|
|
48
|
-
</
|
|
49
|
-
|
|
53
|
+
</SampleBlock>
|
|
54
|
+
</div>
|
|
50
55
|
);
|
|
51
56
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KolAlert, KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextHideLabel: FC = () => (
|
|
@@ -12,15 +13,15 @@ export const InputTextHideLabel: FC = () => (
|
|
|
12
13
|
</p>
|
|
13
14
|
</SampleDescription>
|
|
14
15
|
|
|
15
|
-
<
|
|
16
|
+
<SampleBlock id="search">
|
|
16
17
|
<KolInputText _hideLabel _label="Search" _placeholder="Search..." _type="search" />
|
|
17
|
-
</
|
|
18
|
+
</SampleBlock>
|
|
18
19
|
|
|
19
|
-
<
|
|
20
|
+
<SampleBlock id="error">
|
|
20
21
|
<KolInputText _hideLabel _label="Email" _placeholder="Enter email" _msg={{ _type: 'error', _description: 'Invalid email format' }} _touched />
|
|
21
|
-
</
|
|
22
|
+
</SampleBlock>
|
|
22
23
|
|
|
23
|
-
<
|
|
24
|
+
<SampleBlock id="address-group">
|
|
24
25
|
<fieldset className="grid md:grid-cols-2 gap-4">
|
|
25
26
|
<legend>Street Address</legend>
|
|
26
27
|
<KolAlert className="col-span-2" _level={0} _type="error">
|
|
@@ -43,6 +44,6 @@ export const InputTextHideLabel: FC = () => (
|
|
|
43
44
|
_touched
|
|
44
45
|
/>
|
|
45
46
|
</fieldset>
|
|
46
|
-
</
|
|
47
|
+
</SampleBlock>
|
|
47
48
|
</div>
|
|
48
49
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KolAlert, KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextHideMsg: FC = () => (
|
|
@@ -12,10 +13,10 @@ export const InputTextHideMsg: FC = () => (
|
|
|
12
13
|
</p>
|
|
13
14
|
</SampleDescription>
|
|
14
15
|
|
|
15
|
-
<
|
|
16
|
+
<SampleBlock id="single-error">
|
|
16
17
|
<KolInputText _msg={{ _type: 'error', _description: 'Error message' }} _label="Input with error" _touched />
|
|
17
|
-
</
|
|
18
|
-
<
|
|
18
|
+
</SampleBlock>
|
|
19
|
+
<SampleBlock id="combined-error">
|
|
19
20
|
<fieldset className="grid md:grid-cols-2 gap-4">
|
|
20
21
|
<legend>Combined input field</legend>
|
|
21
22
|
<KolAlert className="col-span-2" _level={0} _type="error">
|
|
@@ -24,6 +25,6 @@ export const InputTextHideMsg: FC = () => (
|
|
|
24
25
|
<KolInputText _msg={{ _type: 'error', _description: 'This is a combined error message' }} _hideMsg _label="First input" _touched />
|
|
25
26
|
<KolInputText _msg={{ _type: 'error', _description: 'This is a combined error message' }} _hideMsg _label="Second input with error" _touched />
|
|
26
27
|
</fieldset>
|
|
27
|
-
</
|
|
28
|
+
</SampleBlock>
|
|
28
29
|
</div>
|
|
29
30
|
);
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextMessageTypes: FC = () => (
|
|
7
|
-
|
|
8
|
+
<div className="grid gap-4">
|
|
8
9
|
<SampleDescription>
|
|
9
10
|
<p>This story demonstrates all available message types for KolInputText: default, info, error, warning, and success.</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="msg-default">
|
|
13
14
|
<KolInputText _label="Default message" _value="Valid value" _msg={{ _type: 'default', _description: 'This is a default message' }} _touched />
|
|
15
|
+
</SampleBlock>
|
|
16
|
+
<SampleBlock id="msg-error">
|
|
14
17
|
<KolInputText _label="Error message" _value="Invalid value" _msg={{ _type: 'error', _description: 'This is an error message' }} _touched />
|
|
18
|
+
</SampleBlock>
|
|
19
|
+
<SampleBlock id="msg-info">
|
|
15
20
|
<KolInputText _label="Info message" _value="Some value" _msg={{ _type: 'info', _description: 'This is an informational message' }} _touched />
|
|
21
|
+
</SampleBlock>
|
|
22
|
+
<SampleBlock id="msg-success">
|
|
16
23
|
<KolInputText _label="Success message" _value="Valid value" _msg={{ _type: 'success', _description: 'This is a success message' }} _touched />
|
|
24
|
+
</SampleBlock>
|
|
25
|
+
<SampleBlock id="msg-warning">
|
|
17
26
|
<KolInputText _label="Warning message" _value="Valid value" _msg={{ _type: 'warning', _description: 'This is a warning message' }} _touched />
|
|
18
|
-
</
|
|
19
|
-
|
|
27
|
+
</SampleBlock>
|
|
28
|
+
</div>
|
|
20
29
|
);
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextMsgAndCounter: FC = () => (
|
|
7
|
-
|
|
8
|
+
<div className="grid gap-4">
|
|
8
9
|
<SampleDescription>
|
|
9
10
|
<p>Regression sample for #9073: when both _msg and _hasCounter are set, aria-describedby must reference both the message and counter elements.</p>
|
|
10
11
|
<p>Open DevTools and inspect each input to confirm aria-describedby contains both IDs.</p>
|
|
11
12
|
</SampleDescription>
|
|
12
13
|
|
|
13
|
-
<
|
|
14
|
+
<SampleBlock id="warning">
|
|
14
15
|
<KolInputText _label="Warning + Counter" _msg={{ _type: 'warning', _description: 'Bitte prüfen Sie Ihre Eingabe.' }} _hasCounter _maxLength={30} />
|
|
16
|
+
</SampleBlock>
|
|
17
|
+
<SampleBlock id="error">
|
|
15
18
|
<KolInputText
|
|
16
19
|
_label="Error + Counter (touched)"
|
|
17
20
|
_msg={{ _type: 'error', _description: 'Pflichtfeld – bitte ausfüllen.' }}
|
|
@@ -19,7 +22,9 @@ export const InputTextMsgAndCounter: FC = () => (
|
|
|
19
22
|
_maxLength={30}
|
|
20
23
|
_touched
|
|
21
24
|
/>
|
|
25
|
+
</SampleBlock>
|
|
26
|
+
<SampleBlock id="info">
|
|
22
27
|
<KolInputText _label="Info + Counter" _msg={{ _type: 'info', _description: 'Hinweis: maximal 20 Zeichen.' }} _hasCounter _maxLength={20} />
|
|
23
|
-
</
|
|
24
|
-
|
|
28
|
+
</SampleBlock>
|
|
29
|
+
</div>
|
|
25
30
|
);
|
|
@@ -2,6 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolInputText } from '@public-ui/react-v19';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
const PATTERN = '^[A-Za-z]{3}-\\d{3}$';
|
|
@@ -11,20 +12,22 @@ export const InputTextPattern: FC = () => (
|
|
|
11
12
|
<SampleDescription>
|
|
12
13
|
<p>This sample demonstrates HTML5 pattern validation for both native input and KolInputText components.</p>
|
|
13
14
|
</SampleDescription>
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
<SampleBlock id="pattern">
|
|
16
|
+
<form className="grid gap-4">
|
|
17
|
+
<div className="grid gap-2">
|
|
18
|
+
<label htmlFor="native-input">Native Input (Pattern: AAA-123, case-insensitive)</label>
|
|
19
|
+
<input id="native-input" name="native-input" pattern={PATTERN} type="text" />
|
|
20
|
+
</div>
|
|
21
|
+
<KolInputText
|
|
22
|
+
_label="KoliBri Input (Pattern: AAA-123, case-insensitive)"
|
|
23
|
+
_name="kolibri-input"
|
|
24
|
+
_pattern={PATTERN}
|
|
25
|
+
_hint="Note: This input is not linked to the form element. The validation inside the Shadow DOM is currently not triggered on form submit."
|
|
26
|
+
/>
|
|
27
|
+
<div>
|
|
28
|
+
<button type="submit">Submit</button>
|
|
29
|
+
</div>
|
|
30
|
+
</form>
|
|
31
|
+
</SampleBlock>
|
|
29
32
|
</>
|
|
30
33
|
);
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextPlaceholder: FC = () => (
|
|
7
|
-
|
|
8
|
+
<div className="grid gap-4">
|
|
8
9
|
<SampleDescription>
|
|
9
10
|
<p>This story demonstrates the placeholder feature of KolInputText.</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="first-name">
|
|
13
14
|
<KolInputText _label="First name" _placeholder="Enter your first name" />
|
|
15
|
+
</SampleBlock>
|
|
16
|
+
<SampleBlock id="email">
|
|
14
17
|
<KolInputText _label="Email address" _placeholder="user@example.com" />
|
|
18
|
+
</SampleBlock>
|
|
19
|
+
<SampleBlock id="tel">
|
|
15
20
|
<KolInputText _label="Phone number" _placeholder="+49 123 456789" _type="tel" />
|
|
21
|
+
</SampleBlock>
|
|
22
|
+
<SampleBlock id="url">
|
|
16
23
|
<KolInputText _label="Website" _placeholder="https://example.com" _type="url" />
|
|
24
|
+
</SampleBlock>
|
|
25
|
+
<SampleBlock id="search">
|
|
17
26
|
<KolInputText _label="Search" _placeholder="Search..." _type="search" />
|
|
18
|
-
</
|
|
19
|
-
|
|
27
|
+
</SampleBlock>
|
|
28
|
+
</div>
|
|
20
29
|
);
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const InputTextReadonly: FC = () => (
|
|
7
|
-
|
|
8
|
+
<div className="grid gap-4">
|
|
8
9
|
<SampleDescription>
|
|
9
10
|
<p>This story demonstrates the readonly state of KolInputText. Readonly inputs can be focused but not edited.</p>
|
|
10
11
|
</SampleDescription>
|
|
11
12
|
|
|
12
|
-
<
|
|
13
|
+
<SampleBlock id="placeholder">
|
|
13
14
|
<KolInputText _label="Readonly with placeholder" _placeholder="Placeholder text" _readOnly />
|
|
15
|
+
</SampleBlock>
|
|
16
|
+
<SampleBlock id="value">
|
|
14
17
|
<KolInputText _label="Readonly with value" _value="This field is readonly" _readOnly />
|
|
18
|
+
</SampleBlock>
|
|
19
|
+
<SampleBlock id="info">
|
|
15
20
|
<KolInputText
|
|
16
21
|
_label="Readonly with info message"
|
|
17
22
|
_value="Read-only value"
|
|
@@ -19,7 +24,9 @@ export const InputTextReadonly: FC = () => (
|
|
|
19
24
|
_readOnly
|
|
20
25
|
_touched
|
|
21
26
|
/>
|
|
27
|
+
</SampleBlock>
|
|
28
|
+
<SampleBlock id="editable">
|
|
22
29
|
<KolInputText _label="Comparison: Editable" _value="This field is editable" />
|
|
23
|
-
</
|
|
24
|
-
|
|
30
|
+
</SampleBlock>
|
|
31
|
+
</div>
|
|
25
32
|
);
|
|
@@ -3,6 +3,7 @@ import { InputTextAccessShortKey } from './access-short-key';
|
|
|
3
3
|
import { InputTextAriaDetails } from './aria-details';
|
|
4
4
|
import { InputTextBackground } from './background-test';
|
|
5
5
|
import { InputTextBasic } from './basic';
|
|
6
|
+
import { InputTextClearButton } from './clear-button';
|
|
6
7
|
import { InputTextCounter } from './counter';
|
|
7
8
|
import { InputTextDisabled } from './disabled';
|
|
8
9
|
import { InputTextExpertSlot } from './expert-slot';
|
|
@@ -23,6 +24,7 @@ export const INPUT_TEXT_ROUTES: Routes = {
|
|
|
23
24
|
'input-text': {
|
|
24
25
|
'aria-details': InputTextAriaDetails,
|
|
25
26
|
basic: InputTextBasic,
|
|
27
|
+
'clear-button': InputTextClearButton,
|
|
26
28
|
'get-value': InputTextOnInputOnChange,
|
|
27
29
|
'message-types': InputTextMessageTypes,
|
|
28
30
|
placeholder: InputTextPlaceholder,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KolButtonLink, KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { SampleBlock } from '../SampleBlock';
|
|
3
4
|
import { SampleDescription } from '../SampleDescription';
|
|
4
5
|
|
|
5
6
|
export const InputTextSelectRange = () => {
|
|
@@ -25,12 +26,12 @@ export const InputTextSelectRange = () => {
|
|
|
25
26
|
<SampleDescription>
|
|
26
27
|
<p>This sample shows how to change the selection in a KolInputText.</p>
|
|
27
28
|
</SampleDescription>
|
|
28
|
-
<
|
|
29
|
+
<SampleBlock id="select-range">
|
|
29
30
|
<KolInputText _value="Very long value" _label="Text Input Label" ref={textInput} />
|
|
30
31
|
<KolButtonLink _label="Set Start" onClick={setSelectioStart} />
|
|
31
32
|
<KolButtonLink _label="Set Range" onClick={setSelectionRange} />
|
|
32
33
|
<KolButtonLink _label="Set Range Text" onClick={setRangeText} />
|
|
33
|
-
</
|
|
34
|
+
</SampleBlock>
|
|
34
35
|
</>
|
|
35
36
|
);
|
|
36
37
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ToasterService } from '@public-ui/components';
|
|
2
2
|
import { KolInputText } from '@public-ui/react-v19';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
const smartButtonProps = {
|
|
@@ -31,12 +32,12 @@ export const InputTextSmartButton = () => {
|
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
return (
|
|
34
|
-
|
|
35
|
+
<div className="grid gap-4">
|
|
35
36
|
<SampleDescription>
|
|
36
37
|
<p>This sample shows the smart button feature for KolInputText. It allows the usage of a button inside the bnput.</p>
|
|
37
38
|
</SampleDescription>
|
|
38
39
|
|
|
39
|
-
<
|
|
40
|
+
<SampleBlock id="enabled">
|
|
40
41
|
<KolInputText
|
|
41
42
|
_label="Input with button and icons"
|
|
42
43
|
_type="text"
|
|
@@ -47,6 +48,8 @@ export const InputTextSmartButton = () => {
|
|
|
47
48
|
}}
|
|
48
49
|
_icons={icons}
|
|
49
50
|
></KolInputText>
|
|
51
|
+
</SampleBlock>
|
|
52
|
+
<SampleBlock id="disabled">
|
|
50
53
|
<KolInputText
|
|
51
54
|
_label="Disabled input with button and icons"
|
|
52
55
|
_disabled
|
|
@@ -57,7 +60,7 @@ export const InputTextSmartButton = () => {
|
|
|
57
60
|
}}
|
|
58
61
|
_icons={icons}
|
|
59
62
|
></KolInputText>
|
|
60
|
-
</
|
|
61
|
-
|
|
63
|
+
</SampleBlock>
|
|
64
|
+
</div>
|
|
62
65
|
);
|
|
63
66
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KolForm, KolHeading, KolInputText } from '@public-ui/react-v19';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Controller, useForm } from 'react-hook-form';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
4
5
|
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -208,7 +209,7 @@ export function InputTextFormatterDemo() {
|
|
|
208
209
|
field displays the <em>formatted</em> value for better readability.
|
|
209
210
|
</p>
|
|
210
211
|
</SampleDescription>
|
|
211
|
-
<
|
|
212
|
+
<SampleBlock id="iban" className="w-full flex flex-col">
|
|
212
213
|
<div className="p-2">
|
|
213
214
|
<KolHeading _label="Live Formatting - IBAN" _level={2} />
|
|
214
215
|
<p className="text-sm mb-2">Formatting occurs during input with intelligent cursor control</p>
|
|
@@ -239,9 +240,9 @@ export function InputTextFormatterDemo() {
|
|
|
239
240
|
<KolHeading _label="Model (Unformatted Value)" _level={2} />
|
|
240
241
|
<pre className="text-base">{JSON.stringify(ibanForm.watch(), null, 2)}</pre>
|
|
241
242
|
</div>
|
|
242
|
-
</
|
|
243
|
+
</SampleBlock>
|
|
243
244
|
|
|
244
|
-
<
|
|
245
|
+
<SampleBlock id="currency" className="w-full flex flex-col">
|
|
245
246
|
<div className="p-2">
|
|
246
247
|
<KolHeading _label="On-Blur Formatting - Currency" _level={2} />
|
|
247
248
|
<p className="text-sm mb-2">Formatting occurs when leaving the field (onBlur) for uninterrupted input</p>
|
|
@@ -275,7 +276,7 @@ export function InputTextFormatterDemo() {
|
|
|
275
276
|
<KolHeading _label="Model (Numeric Value)" _level={2} />
|
|
276
277
|
<pre className="text-base">{JSON.stringify(currencyForm.watch(), null, 2)}</pre>
|
|
277
278
|
</div>
|
|
278
|
-
</
|
|
279
|
+
</SampleBlock>
|
|
279
280
|
</>
|
|
280
281
|
);
|
|
281
282
|
}
|
|
@@ -17,12 +17,13 @@ import type { FC } from 'react';
|
|
|
17
17
|
import React, { useMemo } from 'react';
|
|
18
18
|
import { useSearchParams } from 'react-router';
|
|
19
19
|
import { fetchVariantData } from '../../shares/fetchVariantData';
|
|
20
|
-
import {
|
|
20
|
+
import { getTheme } from '../../shares/store';
|
|
21
|
+
import { SampleBlock, toKebabCase } from '../SampleBlock';
|
|
21
22
|
import { SampleDescription } from '../SampleDescription';
|
|
22
23
|
|
|
23
24
|
export const InputVariant: FC = () => {
|
|
24
25
|
const [searchParams] = useSearchParams();
|
|
25
|
-
const theme = searchParams.get('theme') ??
|
|
26
|
+
const theme = searchParams.get('theme') ?? getTheme();
|
|
26
27
|
const inputVariants = useMemo(() => (theme ? fetchVariantData(theme, 'inputVariants') : []), [theme]);
|
|
27
28
|
|
|
28
29
|
return (
|
|
@@ -33,12 +34,13 @@ export const InputVariant: FC = () => {
|
|
|
33
34
|
|
|
34
35
|
<div className="grid grid-cols-2 gap-8 p-8">
|
|
35
36
|
{!Array.isArray(inputVariants) || inputVariants.length === 0 ? (
|
|
36
|
-
<
|
|
37
|
+
<SampleBlock id="no-variants">
|
|
38
|
+
<p>This theme has no variants for inputs.</p>
|
|
39
|
+
</SampleBlock>
|
|
37
40
|
) : (
|
|
38
41
|
inputVariants.map((element) => {
|
|
39
42
|
return (
|
|
40
|
-
<
|
|
41
|
-
<h2>Variante: {element}</h2>
|
|
43
|
+
<SampleBlock key={element} id={`variant-${toKebabCase(String(element))}`} heading={`Variante: ${String(element)}`} className="grid gap-4 p-8">
|
|
42
44
|
<KolInputText
|
|
43
45
|
_label="Input Text"
|
|
44
46
|
_hint="Enter your surname"
|
|
@@ -81,7 +83,7 @@ export const InputVariant: FC = () => {
|
|
|
81
83
|
_variant={element}
|
|
82
84
|
/>
|
|
83
85
|
<KolTextarea _label="Textarea" _variant={element} />
|
|
84
|
-
</
|
|
86
|
+
</SampleBlock>
|
|
85
87
|
);
|
|
86
88
|
})
|
|
87
89
|
)}
|