@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
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { KolProgress } from '@public-ui/react-v19';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleBlock } from '../SampleBlock';
|
|
6
7
|
import { SampleDescription } from '../SampleDescription';
|
|
7
8
|
|
|
8
9
|
export const ProgressBasic: FC = () => (
|
|
@@ -12,21 +13,21 @@ export const ProgressBasic: FC = () => (
|
|
|
12
13
|
</SampleDescription>
|
|
13
14
|
|
|
14
15
|
<div className="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
|
15
|
-
<
|
|
16
|
+
<SampleBlock id="percentages" heading="Percentages" className="flex flex-col gap-4">
|
|
16
17
|
<KolProgress _variant="bar" _max={7} _value={0}></KolProgress>
|
|
17
18
|
<KolProgress _variant="bar" _max={7} _value={2}></KolProgress>
|
|
18
19
|
<KolProgress _variant="bar" _max={7} _value={7}></KolProgress>
|
|
19
20
|
<KolProgress _variant="cycle" _max={7} _value={6}></KolProgress>
|
|
20
|
-
</
|
|
21
|
-
<
|
|
21
|
+
</SampleBlock>
|
|
22
|
+
<SampleBlock id="custom-units" heading="Custom units" className="flex flex-col gap-4">
|
|
22
23
|
<KolProgress _label="Distance" _variant="bar" _max={65434} _value={7236} _unit="m"></KolProgress>
|
|
23
24
|
<KolProgress _label="12 Tasks to do" _variant="bar" _max={12} _value={5} _unit="tasks completed"></KolProgress>
|
|
24
25
|
<KolProgress _label="Max 150 kg" _variant="cycle" _max={150} _value={42} _unit="kg"></KolProgress>
|
|
25
|
-
</
|
|
26
|
-
<
|
|
26
|
+
</SampleBlock>
|
|
27
|
+
<SampleBlock id="min-max" heading="Min & Max" className="flex flex-col gap-4">
|
|
27
28
|
<KolProgress _label="More than max" _variant="bar" _max={7} _value={14}></KolProgress>
|
|
28
29
|
<KolProgress _label="Less than min" _variant="bar" _max={7} _value={-7}></KolProgress>
|
|
29
|
-
</
|
|
30
|
+
</SampleBlock>
|
|
30
31
|
</div>
|
|
31
32
|
</>
|
|
32
33
|
);
|
|
@@ -2,6 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolQuote } from '@public-ui/react-v19';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const QuoteBasic: FC = () => (
|
|
@@ -10,6 +11,8 @@ export const QuoteBasic: FC = () => (
|
|
|
10
11
|
<p>KolQuote renders a quote with optional citation. This sample shows a quote in the variant "inline" with a link for citation.</p>
|
|
11
12
|
</SampleDescription>
|
|
12
13
|
|
|
13
|
-
<
|
|
14
|
+
<SampleBlock id="basic">
|
|
15
|
+
<KolQuote _href="https://datatracker.ietf.org/doc/html/rfc1149" _quote="Avian carriers can provide high delay." _variant="inline"></KolQuote>
|
|
16
|
+
</SampleBlock>
|
|
14
17
|
</>
|
|
15
18
|
);
|
|
@@ -2,6 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolQuote } from '@public-ui/react-v19';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const QuoteBlock: FC = () => (
|
|
@@ -10,17 +11,19 @@ export const QuoteBlock: FC = () => (
|
|
|
10
11
|
<p>This sample shows a quote in the "block" variant.</p>
|
|
11
12
|
</SampleDescription>
|
|
12
13
|
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<SampleBlock id="block">
|
|
15
|
+
<KolQuote
|
|
16
|
+
_label="RFC 1149"
|
|
17
|
+
_href="https://datatracker.ietf.org/doc/html/rfc1149"
|
|
18
|
+
_quote="Avian carriers can provide high delay, low throughput, and low altitude
|
|
17
19
|
service. The connection topology is limited to a single point-to-point path
|
|
18
20
|
for each carrier, used with standard carriers, but many carriers can be used
|
|
19
21
|
without significant interference with each other, outside early spring.
|
|
20
22
|
This is because of the 3D ether space available to the carriers, in contrast
|
|
21
23
|
to the 1D ether used by IEEE802.3. The carriers have an intrinsic collision
|
|
22
24
|
avoidance system, which increases availability."
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
_variant="block"
|
|
26
|
+
></KolQuote>
|
|
27
|
+
</SampleBlock>
|
|
25
28
|
</>
|
|
26
29
|
);
|
|
@@ -6,6 +6,7 @@ import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
|
|
|
6
6
|
|
|
7
7
|
import type { Components, Optgroup, SelectOption, StencilUnknown } from '@public-ui/components';
|
|
8
8
|
import { COUNTRY_OPTIONS } from '../../../shares/country';
|
|
9
|
+
import { SampleBlock } from '../../SampleBlock';
|
|
9
10
|
|
|
10
11
|
const SALUTATION_OPTIONS: SelectOption<string>[] = [
|
|
11
12
|
{
|
|
@@ -47,41 +48,80 @@ const groupedOptions: GroupedOptionsType = COUNTRY_OPTIONS.reduce((acc, option)
|
|
|
47
48
|
|
|
48
49
|
const groupedOptionsArray = Object.values(groupedOptions);
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
type SelectCasesProps = Components.KolSelect & {
|
|
52
|
+
/** Prefixes the visual block ids so the same cases can be rendered more than once per route. */
|
|
53
|
+
blockIdPrefix: string;
|
|
54
|
+
/**
|
|
55
|
+
* Restricts the snapshots of this rendering to the case with this id; every other block is
|
|
56
|
+
* rendered with `skipSnapshot`. Used for the `_hideLabel` groups: hiding the label mainly
|
|
57
|
+
* changes how the message is laid out, so snapshotting every case a second time would only
|
|
58
|
+
* duplicate the labelled group.
|
|
59
|
+
*/
|
|
60
|
+
snapshotOnly?: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const SelectCases = forwardRef<HTMLKolSelectElement, SelectCasesProps>(function SelectCases({ blockIdPrefix, snapshotOnly, ...props }, ref) {
|
|
64
|
+
// Blocks outside `snapshotOnly` stay visible in the sample but are excluded from the snapshots.
|
|
65
|
+
const block = (caseId: string) => ({ id: `${blockIdPrefix}-${caseId}`, skipSnapshot: snapshotOnly !== undefined && caseId !== snapshotOnly });
|
|
51
66
|
return (
|
|
52
67
|
<div className="grid gap-4">
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
68
|
+
<SampleBlock {...block('salutation-icons')}>
|
|
69
|
+
<KolSelect
|
|
70
|
+
{...props}
|
|
71
|
+
ref={ref}
|
|
72
|
+
_accessKey="a"
|
|
73
|
+
_options={SALUTATION_OPTIONS}
|
|
74
|
+
_label="Salutation"
|
|
75
|
+
_icons={{
|
|
76
|
+
left: {
|
|
77
|
+
icon: 'kolicon-chevron-left',
|
|
78
|
+
},
|
|
79
|
+
right: {
|
|
80
|
+
icon: 'kolicon-chevron-right',
|
|
81
|
+
},
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
</SampleBlock>
|
|
85
|
+
<SampleBlock {...block('disabled')}>
|
|
86
|
+
<KolSelect {...props} _options={SALUTATION_OPTIONS} _label="Disabled" _disabled />
|
|
87
|
+
</SampleBlock>
|
|
88
|
+
<SampleBlock {...block('error')}>
|
|
89
|
+
<KolSelect
|
|
90
|
+
{...props}
|
|
91
|
+
_options={SALUTATION_OPTIONS_DISABLED}
|
|
92
|
+
_label="Salutation with error"
|
|
93
|
+
_msg={{ _type: 'error', _description: ERROR_MSG }}
|
|
94
|
+
_touched
|
|
95
|
+
/>
|
|
96
|
+
</SampleBlock>
|
|
97
|
+
<SampleBlock {...block('multiple')}>
|
|
98
|
+
<KolSelect {...props} _options={COUNTRY_OPTIONS} _label="Multiple choice" _multiple />
|
|
99
|
+
</SampleBlock>
|
|
100
|
+
<SampleBlock {...block('multiple-error')}>
|
|
101
|
+
<KolSelect
|
|
102
|
+
{...props}
|
|
103
|
+
_options={COUNTRY_OPTIONS}
|
|
104
|
+
_label="Multiple choice with error"
|
|
105
|
+
_multiple
|
|
106
|
+
_required
|
|
107
|
+
_msg={{ _type: 'error', _description: ERROR_MSG }}
|
|
108
|
+
_hint={HINT_MSG}
|
|
109
|
+
_touched
|
|
110
|
+
_infoPopover={{ _label: 'hint', _content: 'Ich bin ein Hinweis.', _icons: 'kolicon-alert-info' }}
|
|
111
|
+
/>
|
|
112
|
+
</SampleBlock>
|
|
113
|
+
<SampleBlock {...block('access-key')}>
|
|
114
|
+
<KolSelect {...props} _options={SALUTATION_OPTIONS} _label="With access key" _accessKey="c" />
|
|
115
|
+
</SampleBlock>
|
|
116
|
+
<SampleBlock {...block('short-key')}>
|
|
117
|
+
<KolSelect {...props} _options={SALUTATION_OPTIONS} _label="With short key" _shortKey="s" />
|
|
118
|
+
</SampleBlock>
|
|
119
|
+
<SampleBlock {...block('grouped')}>
|
|
120
|
+
<KolSelect {...props} _options={groupedOptionsArray} _label="With grouped by first letter" _value="Albanien" />
|
|
121
|
+
</SampleBlock>
|
|
122
|
+
<SampleBlock {...block('grouped-multiple')}>
|
|
123
|
+
<KolSelect {...props} _options={groupedOptionsArray} _label="With grouped by first letter (multiple)" _multiple _value={['Albanien']} />
|
|
124
|
+
</SampleBlock>
|
|
85
125
|
</div>
|
|
86
126
|
);
|
|
87
127
|
});
|
|
@@ -4,17 +4,16 @@ import { SelectCases } from './cases';
|
|
|
4
4
|
|
|
5
5
|
import type { Components } from '@public-ui/components';
|
|
6
6
|
import { SampleColumns } from '../../SampleColumns';
|
|
7
|
+
import { SampleGroup } from '../../SampleGroup';
|
|
7
8
|
export const SelectVariants = forwardRef<HTMLKolSelectElement, Components.KolSelect>(function SelectVariant(props, ref) {
|
|
8
9
|
return (
|
|
9
10
|
<SampleColumns>
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<SelectCases ref={ref} {...props} _hideLabel />
|
|
17
|
-
</fieldset>
|
|
11
|
+
<SampleGroup heading="Text">
|
|
12
|
+
<SelectCases blockIdPrefix="label" {...props} />
|
|
13
|
+
</SampleGroup>
|
|
14
|
+
<SampleGroup heading="Text (hideLabel)">
|
|
15
|
+
<SelectCases blockIdPrefix="hide-label" snapshotOnly="error" ref={ref} {...props} _hideLabel />
|
|
16
|
+
</SampleGroup>
|
|
18
17
|
</SampleColumns>
|
|
19
18
|
);
|
|
20
19
|
});
|
|
@@ -7,123 +7,157 @@ import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
|
|
|
7
7
|
import type { Components, Option, StencilUnknown } from '@public-ui/components';
|
|
8
8
|
import { COUNTRY_OPTIONS } from '../../../shares/country';
|
|
9
9
|
import { LONG_OPTIONS } from '../../../shares/longOptions';
|
|
10
|
+
import { SampleBlock } from '../../SampleBlock';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
type SingleSelectCasesProps = Components.KolSingleSelect & {
|
|
13
|
+
/** Prefixes the visual block ids so the same cases can be rendered more than once per route. */
|
|
14
|
+
blockIdPrefix: string;
|
|
15
|
+
/**
|
|
16
|
+
* Restricts the snapshots of this rendering to the case with this id; every other block is
|
|
17
|
+
* rendered with `skipSnapshot`. Used for the `_hideLabel` groups: hiding the label mainly
|
|
18
|
+
* changes how the message is laid out, so snapshotting every case a second time would only
|
|
19
|
+
* duplicate the labelled group.
|
|
20
|
+
*/
|
|
21
|
+
snapshotOnly?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const SingleSelectCases = ({ blockIdPrefix, snapshotOnly, ...props }: SingleSelectCasesProps) => {
|
|
25
|
+
// Blocks outside `snapshotOnly` stay visible in the sample but are excluded from the snapshots.
|
|
26
|
+
const block = (caseId: string) => ({ id: `${blockIdPrefix}-${caseId}`, skipSnapshot: snapshotOnly !== undefined && caseId !== snapshotOnly });
|
|
12
27
|
return (
|
|
13
28
|
<div className="grid gap-4">
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
_options={COUNTRY_OPTIONS as Option<StencilUnknown>[]}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
{...props}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
29
|
+
<SampleBlock {...block('hint')}>
|
|
30
|
+
<KolSingleSelect {...props} _hint={HINT_MSG} _label="Label" _options={COUNTRY_OPTIONS as Option<StencilUnknown>[]} _value={'de'} />
|
|
31
|
+
</SampleBlock>
|
|
32
|
+
<SampleBlock {...block('disabled')}>
|
|
33
|
+
<KolSingleSelect {...props} _label="Disabled" _options={COUNTRY_OPTIONS as Option<StencilUnknown>[]} _value={'de'} _disabled />
|
|
34
|
+
</SampleBlock>
|
|
35
|
+
<SampleBlock {...block('error')}>
|
|
36
|
+
<KolSingleSelect
|
|
37
|
+
{...props}
|
|
38
|
+
_options={COUNTRY_OPTIONS as Option<StencilUnknown>[]}
|
|
39
|
+
_msg={{ _type: 'error', _description: ERROR_MSG }}
|
|
40
|
+
_rows={3}
|
|
41
|
+
_touched
|
|
42
|
+
_label="Label"
|
|
43
|
+
_placeholder="Placeholder"
|
|
44
|
+
_required
|
|
45
|
+
_infoPopover={{ _label: 'hint', _content: 'Ich bin ein Hinweis.', _icons: 'kolicon-alert-info' }}
|
|
46
|
+
/>
|
|
47
|
+
</SampleBlock>
|
|
48
|
+
<SampleBlock {...block('access-key')}>
|
|
49
|
+
<KolSingleSelect {...props} _label="With access key" _options={COUNTRY_OPTIONS as Option<StencilUnknown>[]} _value={'de'} _accessKey="c" />
|
|
50
|
+
</SampleBlock>
|
|
51
|
+
<SampleBlock {...block('short-key')}>
|
|
52
|
+
<KolSingleSelect {...props} _label="With short key" _options={COUNTRY_OPTIONS as Option<StencilUnknown>[]} _value={'de'} _shortKey="s" />
|
|
53
|
+
</SampleBlock>
|
|
54
|
+
<SampleBlock {...block('long-labels')}>
|
|
55
|
+
<KolSingleSelect {...props} _label="With long labels" _options={LONG_OPTIONS as Option<StencilUnknown>[]} _placeholder="Placeholder" />
|
|
56
|
+
</SampleBlock>
|
|
57
|
+
<SampleBlock {...block('no-clear-button')}>
|
|
58
|
+
<KolSingleSelect
|
|
59
|
+
{...props}
|
|
60
|
+
_label="With hidden clear button"
|
|
61
|
+
_options={COUNTRY_OPTIONS as Option<StencilUnknown>[]}
|
|
62
|
+
_value={'de'}
|
|
63
|
+
_hasClearButton={false}
|
|
64
|
+
/>
|
|
65
|
+
</SampleBlock>
|
|
66
|
+
<SampleBlock {...block('boolean-values')}>
|
|
67
|
+
<KolSingleSelect
|
|
68
|
+
{...props}
|
|
69
|
+
_label="Boolean option values (Issue #9122)"
|
|
70
|
+
_options={
|
|
71
|
+
[
|
|
72
|
+
{ label: 'False', value: false },
|
|
73
|
+
{ label: 'True', value: true },
|
|
74
|
+
] as Option<StencilUnknown>[]
|
|
75
|
+
}
|
|
76
|
+
_value={false}
|
|
77
|
+
/>
|
|
78
|
+
</SampleBlock>
|
|
79
|
+
<SampleBlock {...block('disabled-options')}>
|
|
80
|
+
<KolSingleSelect
|
|
81
|
+
{...props}
|
|
82
|
+
_hint={HINT_MSG}
|
|
83
|
+
_label="With disabled options"
|
|
84
|
+
_options={
|
|
85
|
+
[
|
|
86
|
+
{
|
|
87
|
+
value: 'bw',
|
|
88
|
+
label: 'Baden-Württemberg',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: 'by',
|
|
92
|
+
label: 'Bayern',
|
|
93
|
+
disabled: true,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
value: 'be',
|
|
97
|
+
label: 'Berlin',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
value: 'bb',
|
|
101
|
+
label: 'Brandenburg',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: 'hb',
|
|
105
|
+
label: 'Bremen',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
value: 'hh',
|
|
109
|
+
label: 'Hamburg',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
value: 'he',
|
|
113
|
+
label: 'Hessen',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
value: 'mv',
|
|
117
|
+
label: 'Mecklenburg-Vorpommern',
|
|
118
|
+
disabled: true,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
value: 'ni',
|
|
122
|
+
label: 'Niedersachsen',
|
|
123
|
+
disabled: true,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
value: 'nw',
|
|
127
|
+
label: 'Nordrhein-Westfalen',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
value: 'rp',
|
|
131
|
+
label: 'Rheinland-Pfalz',
|
|
132
|
+
disabled: true,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: 'sl',
|
|
136
|
+
label: 'Saarland',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: 'sn',
|
|
140
|
+
label: 'Sachsen',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: 'st',
|
|
144
|
+
label: 'Sachsen-Anhalt',
|
|
145
|
+
disabled: true,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
value: 'sh',
|
|
149
|
+
label: 'Schleswig-Holstein',
|
|
150
|
+
disabled: true,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: 'th',
|
|
154
|
+
label: 'Thüringen',
|
|
155
|
+
},
|
|
156
|
+
] as Option<StencilUnknown>[]
|
|
157
|
+
}
|
|
158
|
+
_value={'be'}
|
|
159
|
+
/>
|
|
160
|
+
</SampleBlock>
|
|
127
161
|
</div>
|
|
128
162
|
);
|
|
129
163
|
};
|
|
@@ -2,19 +2,18 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { Components } from '@public-ui/components';
|
|
4
4
|
import { SampleColumns } from '../../SampleColumns';
|
|
5
|
+
import { SampleGroup } from '../../SampleGroup';
|
|
5
6
|
import { SingleSelectCases } from './cases';
|
|
6
7
|
|
|
7
8
|
export const SingleSelectVariants = (props: Components.KolSingleSelect) => {
|
|
8
9
|
return (
|
|
9
10
|
<SampleColumns>
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<SingleSelectCases {...props} _hideLabel />
|
|
17
|
-
</fieldset>
|
|
11
|
+
<SampleGroup heading="Text">
|
|
12
|
+
<SingleSelectCases blockIdPrefix="label" {...props} />
|
|
13
|
+
</SampleGroup>
|
|
14
|
+
<SampleGroup heading="Text (hideLabel)">
|
|
15
|
+
<SingleSelectCases blockIdPrefix="hide-label" snapshotOnly="error" {...props} _hideLabel />
|
|
16
|
+
</SampleGroup>
|
|
18
17
|
</SampleColumns>
|
|
19
18
|
);
|
|
20
19
|
};
|
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { KolSpin } from '@public-ui/react-v19';
|
|
3
|
+
import { KolHeading, KolSpin } from '@public-ui/react-v19';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleBlock } from '../SampleBlock';
|
|
6
7
|
import { SampleDescription } from '../SampleDescription';
|
|
8
|
+
import './custom.css';
|
|
7
9
|
|
|
8
10
|
export const SpinBasic: FC = () => (
|
|
9
11
|
<>
|
|
10
12
|
<SampleDescription>
|
|
11
|
-
<p>
|
|
13
|
+
<p>
|
|
14
|
+
KolSpin renders a loading indicator. It supports the variants "dot" (default) and "cycle". With{' '}
|
|
15
|
+
<code>_variant="none"</code> and the expert slot a custom animation can be used – custom animations are not necessarily barrier-free.
|
|
16
|
+
Color and size can be changed with the CSS properties <code>--kol-spin-color</code> and <code>--kol-spin-size</code>. The label (<code>_label</code>) is
|
|
17
|
+
only exposed to assistive technology, so it does not change the visual appearance.
|
|
18
|
+
</p>
|
|
12
19
|
</SampleDescription>
|
|
13
20
|
|
|
14
|
-
<
|
|
21
|
+
<div className="grid gap-8">
|
|
22
|
+
<SampleBlock id="basic" heading="Variant dot (default)" fitContent>
|
|
23
|
+
<KolSpin _show />
|
|
24
|
+
</SampleBlock>
|
|
25
|
+
|
|
26
|
+
<SampleBlock id="cycle" heading="Variant cycle" fitContent>
|
|
27
|
+
<KolSpin _show _variant="cycle" />
|
|
28
|
+
</SampleBlock>
|
|
29
|
+
|
|
30
|
+
<SampleBlock id="custom" heading="Custom animation (expert slot)" fitContent>
|
|
31
|
+
<KolSpin _show _variant="none">
|
|
32
|
+
<span slot="expert" className="loader"></span>
|
|
33
|
+
</KolSpin>
|
|
34
|
+
</SampleBlock>
|
|
35
|
+
|
|
36
|
+
<div>
|
|
37
|
+
<KolHeading _level={2} _label="With label (screen reader only)" />
|
|
38
|
+
<KolSpin _show _label="Loading data..." />
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div>
|
|
42
|
+
<KolHeading _level={2} _label="Custom color and size (CSS properties)" />
|
|
43
|
+
<KolSpin _show style={{ '--kol-spin-color': 'green', '--kol-spin-size': '80' }} />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
15
46
|
</>
|
|
16
47
|
);
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import type { Routes } from '../../shares/types';
|
|
2
2
|
import { SpinBasic } from './basic';
|
|
3
|
-
import { SpinCustom } from './custom';
|
|
4
|
-
import { SpinCycle } from './cycle';
|
|
5
|
-
import { SpinLabel } from './label';
|
|
6
|
-
import { SpinVariables } from './variables';
|
|
7
3
|
|
|
8
4
|
export const SPIN_ROUTES: Routes = {
|
|
9
5
|
spin: {
|
|
10
6
|
basic: SpinBasic,
|
|
11
|
-
cycle: SpinCycle,
|
|
12
|
-
custom: SpinCustom,
|
|
13
|
-
label: SpinLabel,
|
|
14
|
-
variables: SpinVariables,
|
|
15
7
|
},
|
|
16
8
|
};
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { ToolbarItemsPropType } from '@public-ui/components';
|
|
4
4
|
import { KolSplitButton, KolToolbar } from '@public-ui/react-v19';
|
|
5
5
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
6
|
+
import { SampleBlock } from '../SampleBlock';
|
|
6
7
|
import { SampleDescription } from '../SampleDescription';
|
|
7
8
|
|
|
8
9
|
import type { FC } from 'react';
|
|
@@ -43,11 +44,11 @@ export const SplitButtonBasic: FC = () => {
|
|
|
43
44
|
</p>
|
|
44
45
|
</SampleDescription>
|
|
45
46
|
|
|
46
|
-
<
|
|
47
|
+
<SampleBlock id="basic" className="flex flex-col gap-4">
|
|
47
48
|
<KolSplitButton _label="Edit" _on={dummyEventHandler}>
|
|
48
49
|
<KolToolbar _label="Action toolbar" _items={TOOLBAR_ITEMS} _orientation="vertical" />
|
|
49
50
|
</KolSplitButton>
|
|
50
|
-
</
|
|
51
|
+
</SampleBlock>
|
|
51
52
|
</>
|
|
52
53
|
);
|
|
53
54
|
};
|
|
@@ -2,6 +2,7 @@ import type { KoliBriTableHeaderCellWithLogic } from '@public-ui/components';
|
|
|
2
2
|
import { KolTableStateful } from '@public-ui/react-v19';
|
|
3
3
|
import type { FC } from 'react';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
6
|
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
type ProjectTask = {
|
|
@@ -98,8 +99,8 @@ export const TableActionColumns: FC = () => (
|
|
|
98
99
|
</p>
|
|
99
100
|
</SampleDescription>
|
|
100
101
|
|
|
101
|
-
<
|
|
102
|
+
<SampleBlock id="action-columns" className="w-full">
|
|
102
103
|
<KolTableStateful _label="Tasks with action buttons" _headers={HEADERS} _data={DATA} className="block" />
|
|
103
|
-
</
|
|
104
|
+
</SampleBlock>
|
|
104
105
|
</>
|
|
105
106
|
);
|